/* =========================================================
   WePME 共有タスク : Cyber Dark デザインシステム
   ========================================================= */
:root {
    /* ネオン (lime 黄緑 / cyan) */
    --neon: #a3e635;
    --neon-2: #84cc16;
    --cyan: #22d3ee;

    /* ブランド (互換トークン) */
    --primary: #a3e635;
    --primary-600: #bef264;
    --primary-50: rgba(163,230,53,.10);
    --primary-100: rgba(163,230,53,.20);

    /* 背景・面 (ダーク) */
    --bg: #070b12;
    --surface: #0e141f;
    --surface-2: #0b111a;
    --glass: rgba(18,26,38,.66);
    --text: #e6edf3;
    --text-2: #9fb0c0;
    --muted: #5d6f80;
    --border: rgba(140,170,200,.14);
    --border-strong: rgba(140,170,200,.26);

    /* セマンティック (ネオン) */
    --red: #fb3d6a;
    --red-bg: rgba(251,61,106,.14);
    --amber: #fbbf24;
    --amber-bg: rgba(251,191,36,.14);
    --green: #34d399;
    --green-bg: rgba(52,211,153,.14);
    --blue: #38bdf8;
    --blue-bg: rgba(56,189,248,.14);

    /* ステータス */
    --st-todo: #38bdf8;
    --st-prog: #22d3ee;
    --st-done: #a3e635;

    --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
    --sh: 0 8px 30px rgba(0,0,0,.45);
    --sh-md: 0 12px 40px rgba(0,0,0,.55);
    --sh-lg: 0 24px 70px rgba(0,0,0,.7);
    --glow: 0 0 18px rgba(163,230,53,.45);

    --nav-h: 60px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);

    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

    /* テーマ可変トークン (既定: ダーク) */
    color-scheme: dark;
    --field-bg: rgba(10,16,24,.7);
    --pill-bg: rgba(0,0,0,.3);
    --card-bg: linear-gradient(180deg, rgba(20,28,40,.9), rgba(14,20,31,.9));
    --topbar-bg: rgba(8,12,20,.72);
    --bottomnav-bg: rgba(8,12,20,.9);
}

/* ---------- ライトテーマ ---------- */
html[data-theme="light"] {
    color-scheme: light;
    --neon: #65a30d;
    --neon-2: #4d7c0f;
    --cyan: #0891b2;
    --primary: #65a30d;
    --primary-600: #4d7c0f;
    --primary-50: rgba(101,163,13,.10);
    --primary-100: rgba(101,163,13,.20);

    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-2: #f3f6fa;
    --glass: rgba(255,255,255,.72);
    --text: #0f1722;
    --text-2: #475569;
    --muted: #7c8b9a;
    --border: rgba(15,30,50,.10);
    --border-strong: rgba(15,30,50,.20);

    --red: #e11d48;   --red-bg: rgba(225,29,72,.10);
    --amber: #b45309; --amber-bg: rgba(180,83,9,.10);
    --green: #059669; --green-bg: rgba(5,150,105,.10);
    --blue: #0284c7;  --blue-bg: rgba(2,132,199,.10);

    --st-todo: #0ea5e9; --st-prog: #0891b2; --st-done: #65a30d;

    --sh: 0 2px 10px rgba(15,23,42,.08);
    --sh-md: 0 8px 26px rgba(15,23,42,.12);
    --sh-lg: 0 20px 60px rgba(15,23,42,.22);
    --glow: 0 0 14px rgba(101,163,13,.3);

    --field-bg: #ffffff;
    --pill-bg: rgba(15,30,50,.06);
    --card-bg: #ffffff;
    --topbar-bg: rgba(255,255,255,.8);
    --bottomnav-bg: rgba(255,255,255,.92);
}
html[data-theme="light"] body {
    background-image:
        radial-gradient(900px 500px at 85% -10%, rgba(8,145,178,.08), transparent 60%),
        radial-gradient(800px 500px at -5% 0%, rgba(101,163,13,.08), transparent 55%),
        linear-gradient(rgba(15,30,50,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,30,50,.04) 1px, transparent 1px);
}
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }
html[data-theme="light"] .stat .num,
html[data-theme="light"] .gauge .g-val { text-shadow: none; }

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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
        "Segoe UI", "Noto Sans JP", Meiryo, sans-serif;
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 500px at 85% -10%, rgba(34,211,238,.10), transparent 60%),
        radial-gradient(800px 500px at -5% 0%, rgba(163,230,53,.10), transparent 55%),
        linear-gradient(rgba(140,170,200,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140,170,200,.035) 1px, transparent 1px);
    background-size: auto, auto, 46px 46px, 46px 46px;
    background-attachment: fixed;
}
h1, h2, h3 { line-height: 1.35; }
a { color: inherit; }
button { font-family: inherit; }
svg { width: 18px; height: 18px; flex: none; vertical-align: middle; }

/* ---------- 起動スプラッシュ ---------- */
.boot-splash {
    min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1.5rem; background: var(--bg);
}
.boot-logo { color: var(--neon); font-size: 2rem; font-weight: 800; letter-spacing: 4px;
    font-family: var(--mono); text-shadow: 0 0 24px rgba(163,230,53,.6); }
.spinner {
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid rgba(163,230,53,.2); border-top-color: var(--neon);
    animation: spin .8s linear infinite; box-shadow: var(--glow);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   ボタン / フォーム
   ========================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .62rem 1.05rem; border: 1px solid transparent; border-radius: var(--r-sm);
    background: var(--neon); color: #0a1206; font-size: .9rem; font-weight: 700;
    cursor: pointer; text-decoration: none; white-space: nowrap; letter-spacing: .2px;
    transition: all .15s; box-shadow: 0 0 0 1px rgba(163,230,53,.35), 0 6px 18px rgba(132,204,22,.25);
}
.btn:hover { background: var(--primary-600); box-shadow: 0 0 0 1px rgba(190,242,100,.5), 0 0 22px rgba(163,230,53,.5); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.lg { padding: .85rem 1.2rem; font-size: .95rem; }
.btn.sm { padding: .4rem .75rem; font-size: .8rem; }
.btn.ghost { background: rgba(140,170,200,.06); color: var(--text); border-color: var(--border-strong); box-shadow: none; }
.btn.ghost:hover { background: rgba(140,170,200,.12); border-color: var(--neon); color: var(--text); box-shadow: none; }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 0 18px rgba(251,61,106,.4); }
.btn.danger:hover { background: #ff547c; box-shadow: 0 0 22px rgba(251,61,106,.55); }
.btn.icon { padding: .5rem; width: 38px; height: 38px; }
.btn svg { width: 18px; height: 18px; }

label { display: block; font-size: .8rem; color: var(--text-2); margin: .9rem 0 .3rem; font-weight: 600;
    letter-spacing: .3px; }
input, select, textarea {
    width: 100%; padding: .68rem .8rem; border: 1px solid var(--border-strong);
    border-radius: var(--r-sm); font-size: 16px;
    font-family: inherit; background: var(--field-bg); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 88px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px rgba(163,230,53,.18), 0 0 18px rgba(163,230,53,.15);
}
select { -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0c0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .65rem center; background-size: 18px; padding-right: 2.2rem;
}
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.7); }

/* =========================================================
   認証画面 (動くサイバー背景)
   ========================================================= */
.auth-wrap {
    /* ログイン画面はテーマに関わらず常にダーク (システム起動画面の演出) */
    color-scheme: dark;
    --text: #e6edf3; --text-2: #9fb0c0; --muted: #5d6f80;
    --glass: rgba(18,26,38,.66); --border: rgba(140,170,200,.14); --border-strong: rgba(140,170,200,.26);
    --field-bg: rgba(10,16,24,.7); --surface: #0e141f;
    min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden; background: #05080e;
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem calc(1.25rem + env(safe-area-inset-right)) calc(1.25rem + var(--safe-b)) calc(1.25rem + env(safe-area-inset-left));
}
.auth-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.auth-grid {
    position: absolute; inset: -50%; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(163,230,53,.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34,211,238,.10) 1px, transparent 1px);
    background-size: 52px 52px;
    transform: perspective(420px) rotateX(62deg);
    transform-origin: center 70%;
    mask-image: radial-gradient(ellipse 60% 55% at 50% 65%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 65%, #000 30%, transparent 75%);
    animation: gridpan 8s linear infinite;
}
@keyframes gridpan { from { background-position: 0 0; } to { background-position: 0 52px; } }
.auth-glowtop { position: absolute; inset: 0 0 auto 0; height: 40%; z-index: 0; pointer-events: none;
    background: radial-gradient(60% 100% at 50% 0%, rgba(34,211,238,.18), transparent 70%); }

.auth-card {
    position: relative; z-index: 2;
    background: var(--glass); backdrop-filter: blur(16px) saturate(140%);
    border-radius: var(--r-xl); padding: 2.1rem 1.9rem; width: 100%; max-width: 410px;
    border: 1px solid rgba(163,230,53,.22);
    box-shadow: 0 0 0 1px rgba(34,211,238,.08), 0 30px 80px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.05);
    animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.auth-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; }
.auth-brand .mark {
    width: 40px; height: 40px; border-radius: 11px; overflow: hidden;
    background: linear-gradient(150deg, #a3e635, #4d7c0f); display: grid; place-items: center;
    box-shadow: 0 0 22px rgba(163,230,53,.55); }
.auth-brand .mark svg { width: 22px; height: 22px; color: #07120a; }
.auth-brand .mark img { width: 100%; height: 100%; object-fit: cover; }
.auth-card h1 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: 1px;
    background: linear-gradient(90deg, #d9f99d, #a3e635 40%, #22d3ee); -webkit-background-clip: text;
    background-clip: text; color: transparent; }
.auth-card .sub { color: var(--text-2); margin: .15rem 0 1.5rem; font-size: .85rem;
    font-family: var(--mono); letter-spacing: .5px; }
.auth-tabs {
    display: flex; gap: .25rem; margin-bottom: 1.2rem; background: rgba(0,0,0,.3);
    padding: .25rem; border-radius: var(--r); border: 1px solid var(--border);
}
.auth-tabs button {
    flex: 1; padding: .55rem; border: none; background: transparent; color: var(--text-2);
    border-radius: var(--r-sm); cursor: pointer; font-size: .9rem; font-weight: 600; transition: all .15s;
}
.auth-tabs button.active { background: rgba(163,230,53,.14); color: var(--neon);
    box-shadow: inset 0 0 0 1px rgba(163,230,53,.4); text-shadow: 0 0 12px rgba(163,230,53,.5); }

/* =========================================================
   レイアウト
   ========================================================= */
.topbar {
    position: sticky; top: 0; z-index: 30;
    background: var(--topbar-bg); backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
    padding: calc(.65rem + var(--safe-t)) max(clamp(1rem, 2.4vw, 2.2rem), calc((100% - 1600px) / 2)) .65rem;
    display: flex; align-items: center; gap: .8rem;
}
.topbar .brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.08rem;
    letter-spacing: 1px; color: var(--text); }
.topbar .brand .mark { width: 30px; height: 30px; border-radius: 9px; overflow: hidden;
    background: linear-gradient(150deg, #a3e635, #4d7c0f); display: grid; place-items: center;
    box-shadow: 0 0 16px rgba(163,230,53,.5); }
.topbar .brand .mark svg { width: 18px; height: 18px; color: #07120a; }
.topbar .brand .mark img { width: 100%; height: 100%; object-fit: cover; }
.topbar nav { display: flex; gap: .2rem; margin-left: auto; align-items: center; }
.topbar nav a.tab {
    padding: .45rem .8rem; border-radius: var(--r-sm); text-decoration: none;
    color: var(--text-2); font-size: .88rem; font-weight: 600; transition: all .15s;
}
.topbar nav a.tab:hover { background: rgba(140,170,200,.08); color: #fff; }
.topbar nav a.tab.active { background: rgba(163,230,53,.14); color: var(--neon);
    box-shadow: inset 0 0 0 1px rgba(163,230,53,.35); }

.container { width: 100%; max-width: 1600px; margin: 0 auto;
    padding: 1.2rem clamp(1rem, 2.4vw, 2.2rem) calc(1.4rem + var(--safe-b));
    padding-left: max(clamp(1rem, 2.4vw, 2.2rem), env(safe-area-inset-left));
    padding-right: max(clamp(1rem, 2.4vw, 2.2rem), env(safe-area-inset-right)); }

/* アバター */
.avatar {
    --sz: 30px; width: var(--sz); height: var(--sz); border-radius: 50%;
    display: inline-grid; place-items: center; color: #07120a; font-weight: 800;
    font-size: calc(var(--sz) * .42); flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.15);
}
.avatar.lg { --sz: 42px; }
.avatar.sm { --sz: 24px; }

.menu-wrap { position: relative; }
.menu-pop {
    position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--sh-md);
    min-width: 210px; padding: .4rem; z-index: 40; animation: rise .15s ease both;
}
.menu-pop .who { padding: .5rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu-pop .who .nm { font-weight: 700; font-size: .9rem; }
.menu-pop .who .em { font-size: .76rem; color: var(--muted); font-family: var(--mono); }
.menu-pop button {
    width: 100%; text-align: left; border: none; background: transparent; cursor: pointer;
    padding: .55rem .6rem; border-radius: var(--r-sm); font-size: .88rem; color: var(--text);
    display: flex; align-items: center; gap: .5rem;
}
.menu-pop button:hover { background: rgba(251,61,106,.12); color: #fff; }
.menu-pop button svg { width: 16px; height: 16px; color: var(--muted); }

/* =========================================================
   ダッシュボード Hero
   ========================================================= */
.hero {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: var(--glass); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: 1.1rem 1.3rem; margin-bottom: 1rem; position: relative; overflow: hidden;
    backdrop-filter: blur(10px);
}
.hero::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
    background: linear-gradient(var(--neon), var(--cyan)); box-shadow: 0 0 18px rgba(163,230,53,.6); }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(34,211,238,.12), transparent 65%); pointer-events: none; }
.hero-greeting { font-size: 1.18rem; font-weight: 800; }
.hero-greeting span { color: var(--neon); text-shadow: 0 0 16px rgba(163,230,53,.5); }
.hero-sub { color: var(--text-2); font-family: var(--mono); font-size: .82rem; letter-spacing: .6px;
    margin-top: .25rem; display: flex; align-items: center; gap: .5rem; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--neon); flex: none;
    box-shadow: 0 0 10px var(--neon); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* 完了率ゲージ */
.gauge { --p: 0; width: 92px; height: 92px; border-radius: 50%; flex: none;
    background: conic-gradient(var(--neon) calc(var(--p) * 1%), rgba(140,170,200,.12) 0);
    display: grid; place-items: center; position: relative; box-shadow: 0 0 26px rgba(163,230,53,.25); }
.gauge::before { content: ''; position: absolute; inset: 7px; border-radius: 50%;
    background: var(--surface); box-shadow: inset 0 0 16px rgba(0,0,0,.6); }
.gauge .g-val { position: relative; font-family: var(--mono); font-weight: 800; font-size: 1.2rem;
    color: var(--text); text-shadow: 0 0 14px rgba(163,230,53,.6); }
.gauge .g-lbl { position: relative; font-size: .58rem; color: var(--text-2); letter-spacing: 1px;
    margin-top: -2px; }

/* 進捗セグメントバー */
.progress-wrap { margin-bottom: 1.2rem; }
.progress { height: 10px; border-radius: 999px; overflow: hidden; display: flex;
    background: rgba(140,170,200,.08); border: 1px solid var(--border); }
.progress .seg { height: 100%; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.progress .seg.s-todo { background: linear-gradient(90deg,#0ea5e9,#38bdf8); box-shadow: 0 0 10px rgba(56,189,248,.5); }
.progress .seg.s-prog { background: linear-gradient(90deg,#06b6d4,#22d3ee); box-shadow: 0 0 10px rgba(34,211,238,.5); }
.progress .seg.s-done { background: linear-gradient(90deg,#84cc16,#a3e635); box-shadow: 0 0 10px rgba(163,230,53,.55); }
.progress-legend { display: flex; gap: 1rem; margin-top: .5rem; font-size: .72rem; color: var(--text-2);
    font-family: var(--mono); flex-wrap: wrap; }
.progress-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.progress-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* =========================================================
   ステータス集計カード
   ========================================================= */
.page-head { display: flex; align-items: center; gap: .6rem; margin: .2rem 0 1rem; }
.page-head h2 { margin: 0; font-size: 1.25rem; font-weight: 800; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat {
    --gc: var(--neon);
    background: var(--glass); border: 1px solid var(--border); border-radius: var(--r);
    padding: .9rem 1rem; position: relative; overflow: hidden; min-height: 92px;
    display: flex; flex-direction: column; gap: .15rem; transition: transform .15s, border-color .15s, box-shadow .15s;
    backdrop-filter: blur(8px);
}
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gc), transparent); opacity: .9; }
.stat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gc) 45%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--gc) 30%, transparent), 0 14px 40px rgba(0,0,0,.5); }
.stat .ic { position: absolute; right: .7rem; top: .7rem; width: 32px; height: 32px;
    border-radius: 9px; display: grid; place-items: center; color: var(--gc);
    background: color-mix(in srgb, var(--gc) 14%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--gc) 35%, transparent); }
.stat .ic svg { width: 17px; height: 17px; }
.stat .num { font-family: var(--mono); font-size: 1.85rem; font-weight: 800; letter-spacing: -.5px;
    line-height: 1.1; color: var(--text); text-shadow: 0 0 16px color-mix(in srgb, var(--gc) 55%, transparent); }
.stat .lbl { color: var(--text-2); font-size: .78rem; font-weight: 600; letter-spacing: .3px; }
.stat.c-blue   { --gc: #38bdf8; }
.stat.c-indigo { --gc: #22d3ee; }
.stat.c-amber  { --gc: #fbbf24; }
.stat.c-red    { --gc: #fb3d6a; }
.stat.c-green  { --gc: #a3e635; }
.stat.c-violet { --gc: #a78bfa; }

/* ツールバー */
.toolbar { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.search { position: relative; flex: 1; min-width: 180px; }
.search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.3rem; font-size: .92rem; }
.toolbar select { width: auto; font-size: .88rem; padding-top: .55rem; padding-bottom: .55rem; }
.chip-toggle {
    display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .8rem;
    border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: rgba(140,170,200,.05);
    cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--text-2); user-select: none;
    white-space: nowrap; flex: none;
}
.chip-toggle.on { background: rgba(163,230,53,.14); border-color: var(--neon); color: var(--neon);
    box-shadow: 0 0 14px rgba(163,230,53,.25); }
.chip-toggle input { display: none; }

/* =========================================================
   プロジェクト切替バー
   ========================================================= */
.proj-bar { display: flex; gap: .5rem; overflow-x: auto; padding: .15rem .1rem .55rem; margin-bottom: .9rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.proj-bar::-webkit-scrollbar { display: none; }
.proj-chip {
    display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--glass); color: var(--text-2);
    font-size: .86rem; font-weight: 600; white-space: nowrap; cursor: pointer; flex: none;
    transition: all .15s; backdrop-filter: blur(6px);
}
.proj-chip:hover { color: var(--text); border-color: var(--muted); }
.proj-chip.active { background: rgba(163,230,53,.14); border-color: var(--neon); color: var(--neon);
    box-shadow: 0 0 16px rgba(163,230,53,.22); }
.proj-chip .pdot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }
.proj-chip .proj-count { font-family: var(--mono); font-size: .72rem; opacity: .75; }
.proj-chip .edit { display: inline-grid; place-items: center; opacity: .8; margin-left: .1rem; }
.proj-chip .edit svg { width: 14px; height: 14px; }
.proj-chip.add { border-style: dashed; color: var(--text-2); }
.proj-chip.add:hover { color: var(--neon); border-color: var(--neon); }

/* カラースウォッチ (プロジェクト編集) */
.swatches { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .35rem; }
.swatch { width: 32px; height: 32px; border-radius: 9px; cursor: pointer; border: 2px solid transparent;
    transition: transform .1s; }
.swatch:hover { transform: scale(1.08); }
.swatch.sel { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 14px currentColor; }

/* タスクカードのプロジェクトバッジ */
.badge.proj i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 5px currentColor; }

/* =========================================================
   カンバン
   ========================================================= */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; align-items: start; }
.col { background: rgba(140,170,200,.04); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: .55rem; transition: background .15s, box-shadow .15s, border-color .15s; min-height: 80px; }
.col.drop-target { background: rgba(163,230,53,.08); border-color: var(--neon);
    box-shadow: inset 0 0 0 1px var(--neon), 0 0 26px rgba(163,230,53,.25); }
.col-head { display: flex; align-items: center; gap: .45rem; padding: .4rem .5rem .7rem; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.col-head .ttl { font-weight: 700; font-size: .9rem; letter-spacing: .3px; }
.col-head .count { margin-left: auto; color: var(--text-2); font-weight: 700; font-size: .78rem;
    background: var(--pill-bg); padding: .05rem .55rem; border-radius: 999px; font-family: var(--mono);
    border: 1px solid var(--border); }
.col[data-status="todo"] .dot { background: var(--st-todo); box-shadow: 0 0 8px var(--st-todo); }
.col[data-status="in_progress"] .dot { background: var(--st-prog); box-shadow: 0 0 8px var(--st-prog); }
.col[data-status="done"] .dot { background: var(--st-done); box-shadow: 0 0 8px var(--st-done); }

.task-card {
    background: var(--card-bg);
    border-radius: var(--r); padding: .75rem .8rem; margin-bottom: .55rem;
    cursor: pointer; position: relative; border: 1px solid var(--border);
    transition: box-shadow .15s, transform .08s, border-color .15s, opacity .15s;
    touch-action: pan-y; animation: cardin .25s ease both;
}
@keyframes cardin { from { opacity: 0; transform: translateY(6px); } }
.task-card:hover { border-color: var(--border-strong); box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(163,230,53,.12); }
.task-card:active { transform: scale(.99); }
.task-card.dragging { opacity: .35; }
.task-card .pbar { position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; }
.task-card.p-high .pbar { background: var(--red); box-shadow: 0 0 10px var(--red); }
.task-card.p-normal .pbar { background: var(--neon); box-shadow: 0 0 8px rgba(163,230,53,.6); }
.task-card.p-low .pbar { background: var(--muted); }
.task-card .t-title { font-weight: 650; font-size: .92rem; margin: 0 0 .5rem; padding-left: .5rem; color: var(--text); }
.task-card.done-card .t-title { color: var(--muted); text-decoration: line-through; }
.task-card .t-meta { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; padding-left: .5rem; }

/* ドラッグ中 */
html.dragging-active { touch-action: none; overflow: hidden; cursor: grabbing; }
html.dragging-active body { user-select: none; }
.drag-ghost { position: fixed; z-index: 999; pointer-events: none; width: 260px;
    box-shadow: 0 24px 60px rgba(0,0,0,.7), 0 0 0 1px var(--neon); transform: rotate(2deg); opacity: .96; margin: 0; }

/* バッジ */
.badge {
    display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem;
    border-radius: 999px; font-size: .72rem; font-weight: 600; background: rgba(140,170,200,.08);
    color: var(--text-2); border: 1px solid var(--border); font-family: var(--mono);
}
.badge svg { width: 12px; height: 12px; }
.badge.assignee { background: rgba(163,230,53,.12); color: var(--neon); border-color: rgba(163,230,53,.3); padding-left: .25rem; }
.badge.due-over { background: var(--red-bg); color: var(--red); border-color: rgba(251,61,106,.35); }
.badge.due-soon { background: var(--amber-bg); color: var(--amber); border-color: rgba(251,191,36,.35); }
.badge.prio-high { background: var(--red-bg); color: var(--red); border-color: rgba(251,61,106,.35); }

/* =========================================================
   パネル / メンバー
   ========================================================= */
.panel { background: var(--glass); border: 1px solid var(--border); border-radius: var(--r-lg);
    box-shadow: var(--sh); padding: 1.25rem; margin-bottom: 1rem; backdrop-filter: blur(8px); }
.panel h3 { margin: 0 0 .9rem; font-size: 1.02rem; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.panel h3 svg { color: var(--neon); }
.panel .note { color: var(--text-2); font-size: .86rem; margin: 0 0 .9rem; }

.invite-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.invite-code {
    font-family: var(--mono); font-size: 1.15rem; font-weight: 700;
    background: var(--pill-bg); border: 1px dashed rgba(163,230,53,.4);
    padding: .5rem .9rem; border-radius: var(--r-sm); letter-spacing: 3px; color: var(--neon);
    text-shadow: 0 0 12px rgba(163,230,53,.5); }

.member-list { display: flex; flex-direction: column; gap: .15rem; }
.member-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .4rem; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: none; }
.member-row .mid { flex: 1; min-width: 0; }
.member-row .mid .nm { font-weight: 650; font-size: .92rem; }
.member-row .mid .em { font-size: .8rem; color: var(--muted); font-family: var(--mono);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row .acts { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.role-pill { padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; font-family: var(--mono); }
.role-pill.admin { background: rgba(163,230,53,.16); color: var(--neon); box-shadow: inset 0 0 0 1px rgba(163,230,53,.3); }
.role-pill.member { background: rgba(140,170,200,.1); color: var(--text-2); }
.open-pill { font-size: .74rem; color: var(--text-2); background: var(--pill-bg); padding: .12rem .5rem;
    border-radius: 999px; font-family: var(--mono); border: 1px solid var(--border); }

/* =========================================================
   モーダル
   ========================================================= */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(3,6,12,.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 50;
    animation: fade .2s ease both; overflow-y: auto;
    padding: max(1rem, var(--safe-t)) 1rem max(1rem, var(--safe-b));
}
@keyframes fade { from { opacity: 0; } }
.modal {
    background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 600px;
    box-shadow: var(--sh-lg), 0 0 0 1px rgba(163,230,53,.12); border: 1px solid var(--border-strong);
    animation: pop .26s cubic-bezier(.2,.8,.2,1) both; overflow: hidden;
    max-height: min(90vh, 780px); display: flex; flex-direction: column; margin: auto;
}
@keyframes pop { from { transform: translateY(14px) scale(.985); opacity: .35; } }
.modal-head {
    display: flex; align-items: center; gap: .6rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
    background: var(--surface); z-index: 1; flex: none;
}
.modal-head h2 { margin: 0; font-size: 1.08rem; font-weight: 700; flex: 1; }
.modal-head .x { background: rgba(140,170,200,.1); border: none; width: 34px; height: 34px; border-radius: 50%;
    cursor: pointer; color: var(--text-2); display: grid; place-items: center; }
.modal-head .x:hover { background: rgba(251,61,106,.18); color: #fff; }
.modal-body { padding: 1.1rem 1.25rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: .9rem 1.25rem; border-top: 1px solid var(--border);
    display: flex; gap: .5rem; justify-content: flex-end; background: var(--surface); flex: none; }
.modal-foot .spacer { margin-right: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

/* タイムライン */
.activity { margin-top: 1.4rem; }
.activity h3 { font-size: .92rem; font-weight: 700; margin: 0 0 .7rem; color: var(--text-2);
    display: flex; align-items: center; gap: .4rem; }
.activity h3 svg { color: var(--neon); }
.timeline { display: flex; flex-direction: column; gap: .1rem; }
.tl-item { display: flex; gap: .6rem; padding: .55rem 0; }
.tl-item .body { flex: 1; min-width: 0; }
.tl-item .meta { font-size: .74rem; color: var(--muted); font-family: var(--mono); }
.tl-item .who { font-weight: 700; color: var(--text); }
.tl-item .text { font-size: .9rem; margin-top: .15rem; word-break: break-word; color: var(--text); }
.tl-item.comment { border-bottom: 1px solid var(--border); }
.tl-item.hist { padding: .35rem 0; align-items: center; }
.tl-item.hist .line { font-size: .82rem; color: var(--text-2); }
.tl-item.hist .ic { width: 24px; height: 24px; border-radius: 50%; background: rgba(140,170,200,.1);
    display: grid; place-items: center; flex: none; }
.tl-item.hist .ic svg { width: 13px; height: 13px; color: var(--text-2); }
.comment-box { display: flex; gap: .5rem; margin-top: .9rem; align-items: flex-end; }
.comment-box textarea { min-height: 46px; }

/* モバイル下部タブ */
.bottom-nav { display: none; }

/* 雑多 */
.field-note { font-size: .78rem; color: var(--muted); margin: .4rem 0 0; line-height: 1.5; }
.error-msg { color: var(--red); font-size: .84rem; margin: .6rem 0 0; min-height: 1rem; font-weight: 600;
    text-shadow: 0 0 12px rgba(251,61,106,.4); }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty svg { width: 42px; height: 42px; opacity: .4; margin-bottom: .5rem; }
.empty .t { font-weight: 600; color: var(--text-2); }
.col .empty { padding: 1.2rem .5rem; font-size: .8rem; }
.muted { color: var(--muted); }

/* スケルトン */
.skel { background: linear-gradient(90deg, rgba(140,170,200,.06) 25%, rgba(140,170,200,.12) 50%, rgba(140,170,200,.06) 75%);
    background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { height: 74px; margin-bottom: .55rem; border-radius: var(--r); }
.skel-stat { height: 92px; border-radius: var(--r); }

/* トースト */
.toast {
    position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
    bottom: calc(1.1rem + var(--safe-b)); background: rgba(14,20,31,.95); color: #fff;
    padding: .7rem 1.1rem; border-radius: 999px; font-size: .88rem; font-weight: 600;
    z-index: 100; box-shadow: var(--sh-md); max-width: 90%; display: flex; align-items: center; gap: .5rem;
    opacity: 0; transition: opacity .2s, transform .2s; border: 1px solid var(--border-strong);
    backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 17px; height: 17px; color: var(--neon); }
.toast.err { border-color: rgba(251,61,106,.5); box-shadow: 0 0 24px rgba(251,61,106,.3); }
.toast.err svg { color: var(--red); }
.toast.ok { border-color: rgba(163,230,53,.5); box-shadow: 0 0 24px rgba(163,230,53,.3); }
.toast.ok svg { color: var(--neon); }

/* =========================================================
   レスポンシブ (iPhone)
   ========================================================= */
@media (max-width: 820px) {
    .board { grid-template-columns: 1fr; gap: .7rem; }
    .col { background: transparent; border-color: transparent; padding: 0; }
    .col-head { padding: .2rem .2rem .5rem; }
    .form-row { grid-template-columns: 1fr; }
    .hero { flex-direction: column; align-items: flex-start; }
    .hero-metrics { align-self: stretch; display: flex; justify-content: flex-end; }
}

@media (max-width: 680px) {
    .topbar nav .tab { display: none; }
    .container { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 1rem); }
    .bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        background: var(--bottomnav-bg); backdrop-filter: saturate(160%) blur(14px);
        border-top: 1px solid var(--border); padding-bottom: var(--safe-b);
        height: calc(var(--nav-h) + var(--safe-b));
    }
    .bottom-nav a {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600; padding-top: 6px;
    }
    .bottom-nav a svg { width: 23px; height: 23px; }
    .bottom-nav a.active { color: var(--neon); text-shadow: 0 0 10px rgba(163,230,53,.5); }
    .bottom-nav a .fab {
        position: absolute; top: -22px; width: 52px; height: 52px; border-radius: 50%;
        background: linear-gradient(150deg, #a3e635, #4d7c0f); color: #07120a;
        display: grid; place-items: center; box-shadow: 0 0 24px rgba(163,230,53,.6); }
    .bottom-nav a .fab svg { width: 26px; height: 26px; }
    .modal-foot { flex-wrap: wrap; }
    .modal-foot .btn { flex: 1; }
    .modal-foot .btn.danger { flex: none; }

    /* --- スマホアプリ風の調整 --- */

    /* ツールバー: 検索を全幅・重複する「新規タスク」は右下の＋に任せて非表示 */
    .toolbar { gap: .5rem; }
    .search { flex-basis: 100%; min-width: 0; }
    #newTaskBtn { display: none; }
    .toolbar select { flex: 1; min-width: 0; }

    /* タップ領域を Apple 推奨サイズへ */
    .btn { padding: .7rem 1rem; }
    .btn.sm { padding: .55rem .9rem; }
    .btn.icon { width: 42px; height: 42px; }
    .chip-toggle { padding: .6rem .9rem; }

    /* トーストを下部ナビの上に逃がす */
    .toast { bottom: calc(var(--nav-h) + var(--safe-b) + .8rem); }

    /* モーダルを下からせり上がる「ボトムシート」に */
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal {
        max-width: 100%; width: 100%; max-height: 92dvh; margin: 0;
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        animation: sheetup .3s cubic-bezier(.2,.85,.25,1) both;
    }
    .modal-body { padding-bottom: calc(1.2rem + var(--safe-b)); }
    .modal-foot { padding-bottom: calc(.9rem + var(--safe-b)); }
    /* シート上部に「つまみ」を表示 */
    .modal-head { position: relative; }
    .modal-head::before {
        content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
        width: 38px; height: 4px; border-radius: 999px; background: var(--border-strong);
    }

    /* Hero / ゲージをコンパクトに */
    .hero { padding: 1rem 1.1rem; }
    .hero-greeting { font-size: 1.05rem; }
    .gauge { width: 76px; height: 76px; }

    /* メンバー操作ボタンを押しやすく */
    .member-row .acts .btn { min-height: 40px; }
}

@keyframes sheetup { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
