/* =====================================================================
   RISE Portal — デザインシステム
   ダーク基調（ライト切替可）／オーロラ背景／ガラス質サーフェス
   ===================================================================== */

:root {
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur: 180ms;

  --sidebar-w: 256px;
  --topbar-h: 64px;

  /* ブランドグラデーション */
  --g1: #7c6cff;
  --g2: #3b82f6;
  --g3: #22d3ee;
  --brand-gradient: linear-gradient(120deg, var(--g1) 0%, var(--g2) 50%, var(--g3) 100%);

  /* 状態色 */
  --blue: #60a5fa;
  --amber: #fbbf24;
  --violet: #a78bfa;
  --cyan: #22d3ee;
  --green: #34d399;
  --red: #f87171;
  --gray: #94a3b8;
  --pink: #f472b6;
}

/* ---- ダーク（既定） ---- */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #060912;
  --bg-elev: #0b1020;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .09);
  --surface-solid: #0e1426;
  --surface-solid-2: #131a30;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .14);
  --text: #e8ecf7;
  --text-2: #a7b0c8;
  --text-3: #6f7895;
  --accent: #8b9dff;
  --accent-strong: #6d7dff;
  --accent-soft: rgba(124, 108, 255, .16);
  --focus: rgba(124, 140, 255, .55);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 40px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 30px 80px -20px rgba(0, 0, 0, .75);
  --aurora-1: rgba(124, 108, 255, .22);
  --aurora-2: rgba(34, 211, 238, .13);
  --aurora-3: rgba(59, 130, 246, .16);
  --grid-line: rgba(255, 255, 255, .025);
  --scrim: rgba(3, 6, 14, .66);
  --memo-bg: rgba(251, 191, 36, .07);
  --memo-border: rgba(251, 191, 36, .35);
  --own-bubble: linear-gradient(135deg, rgba(124, 108, 255, .18), rgba(34, 211, 238, .10));
}

/* ---- ライト ---- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fc;
  --bg-elev: #ffffff;
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(15, 23, 42, .04);
  --surface-3: rgba(15, 23, 42, .07);
  --surface-solid: #ffffff;
  --surface-solid-2: #f8f9fd;
  --border: rgba(15, 23, 42, .09);
  --border-strong: rgba(15, 23, 42, .16);
  --text: #0f172a;
  --text-2: #475069;
  --text-3: #8790a8;
  --accent: #5b5bf6;
  --accent-strong: #4f46e5;
  --accent-soft: rgba(91, 91, 246, .1);
  --focus: rgba(91, 91, 246, .45);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -14px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 70px -20px rgba(15, 23, 42, .35);
  --aurora-1: rgba(124, 108, 255, .16);
  --aurora-2: rgba(34, 211, 238, .14);
  --aurora-3: rgba(59, 130, 246, .10);
  --grid-line: rgba(15, 23, 42, .035);
  --scrim: rgba(15, 23, 42, .38);
  --memo-bg: rgba(245, 158, 11, .08);
  --memo-border: rgba(217, 119, 6, .4);
  --own-bubble: linear-gradient(135deg, rgba(91, 91, 246, .09), rgba(34, 211, 238, .07));
  --blue: #2563eb;
  --amber: #d97706;
  --violet: #7c3aed;
  --cyan: #0891b2;
  --green: #059669;
  --red: #dc2626;
  --gray: #64748b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt" 1;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
.icon { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -0.125em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { padding: 40px; text-align: center; }

/* スクロールバー */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ---- 背景（オーロラ＋グリッド） ---- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); animation: drift 26s var(--ease) infinite alternate; }
.aurora span:nth-child(1) { width: 52vw; height: 52vw; left: -12vw; top: -22vw; background: var(--aurora-1); }
.aurora span:nth-child(2) { width: 42vw; height: 42vw; right: -10vw; top: -8vw; background: var(--aurora-2); animation-duration: 32s; }
.aurora span:nth-child(3) { width: 38vw; height: 38vw; left: 30vw; bottom: -26vw; background: var(--aurora-3); animation-duration: 38s; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(4vw, 3vw, 0) scale(1.12); } }

#app { position: relative; z-index: 1; min-height: 100%; }
#app.boot { display: grid; place-items: center; min-height: 100vh; }
.boot-mark .brand-glyph { width: 44px; height: 44px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }

/* ---- ブランド ---- */
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); }
.brand-glyph {
  width: 34px; height: 34px; border-radius: 11px; flex: none; position: relative; display: block;
  background: url("/img/mark.svg") center / 64% no-repeat, var(--brand-gradient);
  box-shadow: 0 8px 26px -6px rgba(124, 108, 255, .6), 0 0 0 1px rgba(255, 255, 255, .12) inset;
}
.brand-name { font-weight: 750; letter-spacing: .02em; font-size: 16px; line-height: 1.1; }
.brand-name b { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: .08em; }

/* ---- レイアウト ---- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; border-right: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-elev) 82%, transparent), color-mix(in srgb, var(--bg) 70%, transparent));
  backdrop-filter: blur(18px) saturate(140%);
}
.sidebar .brand { padding: 4px 8px 18px; }
.nav-label { font-size: 11px; letter-spacing: .12em; color: var(--text-3); padding: 14px 12px 6px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 550; position: relative; transition: background var(--dur), color var(--dur);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--text); }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-gradient);
}
.nav-item .icon { width: 18px; height: 18px; opacity: .9; }
.nav-item .count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text);
}
.nav-item .count.hot { background: var(--brand-gradient); color: #fff; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.org-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface);
}
.org-chip .meta { min-width: 0; }
.org-chip .meta div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-chip .sub { font-size: 11px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
.topbar .mobile-brand { display: none; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; min-width: 320px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-3); cursor: pointer; transition: border-color var(--dur), background var(--dur);
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface-2); }
.search-trigger .kbd { margin-left: auto; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface-2); }
.topbar-spacer { flex: 1; }
.content { padding: 28px 28px 80px; max-width: 1440px; width: 100%; margin: 0 auto; animation: page-in 320ms var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mobile-nav { display: none; }

/* ---- ページ見出し ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 750; letter-spacing: .01em; line-height: 1.25; }
.page-head .lead { margin: 6px 0 0; color: var(--text-2); }
.eyebrow { font-size: 12px; color: var(--text-3); letter-spacing: .06em; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.eyebrow a { color: var(--text-2); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.greeting { font-size: 13px; color: var(--text-2); }
.grad-text { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- ボタン ---- */
.btn {
  --btn-bg: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--btn-bg); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; user-select: none; transition: transform var(--dur) var(--ease), background var(--dur), border-color var(--dur), box-shadow var(--dur), opacity var(--dur);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
  border: 0; color: #fff; background: var(--brand-gradient); background-size: 160% 100%; background-position: 0% 0;
  box-shadow: 0 10px 26px -10px rgba(91, 91, 246, .75), 0 0 0 1px rgba(255, 255, 255, .14) inset;
}
.btn-primary:hover { background: var(--brand-gradient); background-size: 160% 100%; background-position: 100% 0; box-shadow: 0 14px 32px -10px rgba(91, 91, 246, .9), 0 0 0 1px rgba(255, 255, 255, .2) inset; }
.btn-success { border: 0; color: #04120c; background: linear-gradient(120deg, #34d399, #22d3ee); box-shadow: 0 10px 26px -10px rgba(52, 211, 153, .7); }
.btn-success:hover { background: linear-gradient(120deg, #4ae0a8, #3ddcf2); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 8%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 16%, transparent); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 11px; border-radius: 9px; font-size: 12.5px; }
.btn-lg { height: 46px; padding: 0 22px; border-radius: 13px; font-size: 15px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; transition: background var(--dur), color var(--dur);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; color: #fff; background: linear-gradient(120deg, #f472b6, #7c6cff); box-shadow: 0 0 0 2px var(--bg);
  animation: pop 300ms var(--ease-spring);
}
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- カード ---- */
.card {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow); backdrop-filter: blur(14px) saturate(130%);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon, .card-head h3 .icon { width: 17px; height: 17px; color: var(--accent); }
.card-body { padding: 16px 20px; }
.card-glow::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(124, 108, 255, .55), transparent 40%, transparent 60%, rgba(34, 211, 238, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; letter-spacing: .04em; }
.section-title .line { flex: 1; height: 1px; background: var(--border); }

.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ---- KPI ---- */
.kpi { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; cursor: pointer; transition: transform var(--dur) var(--ease), border-color var(--dur); }
.kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); text-decoration: none; }
.kpi .kpi-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.kpi .kpi-value { font-family: var(--font-display); font-size: 34px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--text); }
.kpi .kpi-value small { font-size: 14px; color: var(--text-3); font-weight: 600; margin-left: 4px; }
.kpi .kpi-foot { font-size: 12px; color: var(--text-3); }
.kpi .kpi-orb { position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; filter: blur(28px); opacity: .45; }
.kpi.tone-red .kpi-value { color: var(--red); }

/* ---- 状態・バッジ ---- */
.badge {
  --tone: var(--gray);
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap;
  color: color-mix(in srgb, var(--tone) 92%, var(--text)); background: color-mix(in srgb, var(--tone) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
}
.badge .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 10px var(--tone); }
.badge.live .pip { animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 2px var(--tone); opacity: .6; } }
.badge-sm { height: 20px; padding: 0 8px; font-size: 11px; }
.tone-blue { --tone: var(--blue); } .tone-amber { --tone: var(--amber); } .tone-violet { --tone: var(--violet); }
.tone-cyan { --tone: var(--cyan); } .tone-green { --tone: var(--green); } .tone-gray { --tone: var(--gray); }
.tone-red { --tone: var(--red); } .tone-pink { --tone: var(--pink); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.tag .icon { width: 12px; height: 12px; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--text-2); }
.prio .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.prio .bars i { width: 3px; border-radius: 2px; background: var(--surface-3); }
.prio .bars i:nth-child(1) { height: 5px; } .prio .bars i:nth-child(2) { height: 8px; } .prio .bars i:nth-child(3) { height: 12px; }
.prio.p-normal .bars i:nth-child(-n+1), .prio.p-low .bars i:nth-child(-n+1) { background: var(--text-3); }
.prio.p-normal .bars i:nth-child(-n+2) { background: var(--text-2); }
.prio.p-high .bars i { background: var(--amber); }
.prio.p-urgent { color: var(--red); }
.prio.p-urgent .bars i { background: var(--red); box-shadow: 0 0 8px var(--red); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--g3); box-shadow: 0 0 10px var(--g3); flex: none; }
.overdue { color: var(--red) !important; font-weight: 700; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---- 段階ステッパー ---- */
.stepper { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.step { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.step .bar { height: 6px; border-radius: 6px; background: var(--surface-3); position: relative; overflow: hidden; }
.step.done .bar { background: linear-gradient(90deg, var(--g1), var(--g2)); }
.step.current .bar { background: linear-gradient(90deg, var(--g2), var(--g3)); box-shadow: 0 0 16px rgba(34, 211, 238, .5); }
.step.current .bar::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-100%); animation: sheen 2.4s ease-in-out infinite;
}
@keyframes sheen { to { transform: translateX(100%); } }
.step .label { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.current .label { color: var(--text); font-weight: 700; }
.step.done .label { color: var(--text-2); }
.stepper.compact .label { display: none; }
.stepper.compact .bar { height: 4px; }

/* 依頼の進行（丸ノード） */
.flow { display: flex; align-items: center; gap: 0; }
.flow .node { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; width: 92px; text-align: center; }
.flow .node .ring {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--bg-elev);
  color: var(--text-3); transition: all var(--dur);
}
.flow .node .ring .icon { width: 14px; height: 14px; }
.flow .node.done .ring { border-color: transparent; background: var(--brand-gradient); color: #fff; }
.flow .node.current .ring { border-color: var(--g3); color: var(--g3); box-shadow: 0 0 0 5px rgba(34, 211, 238, .12), 0 0 22px rgba(34, 211, 238, .45); }
.flow .node .lbl { font-size: 12px; color: var(--text-3); font-weight: 600; }
.flow .node.current .lbl { color: var(--text); }
.flow .node.done .lbl { color: var(--text-2); }
.flow .edge { flex: 1; height: 2px; min-width: 16px; background: var(--border-strong); margin-bottom: 26px; border-radius: 2px; }
.flow .edge.done { background: linear-gradient(90deg, var(--g1), var(--g3)); }

/* 進捗リング */
.ring-progress { position: relative; width: 52px; height: 52px; flex: none; }
.ring-progress svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.ring-progress .track { stroke: var(--surface-3); }
.ring-progress .value { stroke: url(#rp-grad); transition: stroke-dashoffset 700ms var(--ease); }
.ring-progress .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }

/* ---- 案件カード ---- */
.project-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; color: var(--text); transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur); }
.project-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); text-decoration: none; }
.project-card .pc-top { display: flex; gap: 14px; align-items: flex-start; }
.project-card .pc-title { font-size: 15.5px; font-weight: 700; line-height: 1.4; margin: 2px 0 4px; }
.project-card .pc-org { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.project-card .pc-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.project-card .pc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 12px; }
.stat-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--text-2); }
.stat-pill b { color: var(--text); font-variant-numeric: tabular-nums; }
.stat-pill.attn { background: color-mix(in srgb, var(--cyan) 13%, transparent); color: var(--cyan); }
.stat-pill.attn b { color: var(--cyan); }
.stat-pill.warn { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.stat-pill.warn b { color: var(--red); }

/* ---- 表 ---- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; color: var(--text-3); font-weight: 650; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: color-mix(in srgb, var(--surface-solid) 60%, transparent); position: sticky; top: 0; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background var(--dur); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .t-title { font-weight: 650; display: flex; align-items: center; gap: 8px; min-width: 220px; }
.table .t-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.table .num { font-variant-numeric: tabular-nums; }

/* ---- リスト（依頼行） ---- */
.list { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border);
  color: var(--text); transition: background var(--dur);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); text-decoration: none; }
.row .r-main { min-width: 0; }
.row .r-title { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.row .r-title span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.row .r-meta .icon { width: 13px; height: 13px; display: inline; vertical-align: -2px; }
.row .r-side { display: flex; align-items: center; gap: 10px; }
.type-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; border: 1px solid var(--border); }
.type-icon .icon { width: 17px; height: 17px; }
.type-icon.t-change { color: var(--blue); } .type-icon.t-fix { color: var(--amber); } .type-icon.t-add { color: var(--green); }
.type-icon.t-delete { color: var(--red); } .type-icon.t-question { color: var(--violet); } .type-icon.t-other { color: var(--gray); }

/* ---- タブ・セグメント ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--text-2); font-weight: 650; cursor: pointer; border: 0; background: none; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand-gradient); }
.tab .count { font-size: 11px; padding: 0 7px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); }
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.segmented button { height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button .icon { width: 15px; height: 15px; }
.segmented button.active { background: var(--surface-solid-2); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.toolbar > .select { width: auto; min-width: 150px; max-width: 240px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all var(--dur); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--text); }
.chip .n { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---- フォーム ---- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 650; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field .req { color: var(--pink); font-size: 11px; }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
  color: var(--text); outline: none; transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.textarea { height: auto; min-height: 110px; padding: 11px 13px; resize: vertical; line-height: 1.7; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-strong)); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: var(--surface-solid); color: var(--text); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.error-text { color: var(--red); font-size: 12.5px; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent-strong); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 36px; height: 21px; border-radius: 11px; background: var(--surface-3); position: relative; transition: background var(--dur); border: 1px solid var(--border-strong); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease-spring); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + .track { background: var(--amber); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* 種類選択カード */
.type-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-option {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer; transition: all var(--dur) var(--ease); text-align: left;
}
.type-option:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border-strong)); transform: translateY(-1px); }
.type-option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.type-option .to-label { font-weight: 700; }
.type-option .to-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; margin-top: 2px; }
.type-option .check-mark { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-gradient); color: #fff; display: none; place-items: center; }
.type-option .check-mark .icon { width: 11px; height: 11px; }
.type-option.selected .check-mark { display: grid; }

/* ---- ドロップゾーン・アップロード ---- */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; color: var(--text-2);
  transition: all var(--dur); background: var(--surface);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone .icon { width: 26px; height: 26px; margin: 0 auto 8px; color: var(--accent); }
.dropzone .dz-title { font-weight: 700; }
.dropzone .dz-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.upload-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.upload-list:empty { display: none; }
.upload-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface-solid-2); max-width: 280px; overflow: hidden; animation: page-in 220ms var(--ease);
}
.upload-item .thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; flex: none; color: var(--text-2); }
.upload-item .thumb .icon { width: 16px; height: 16px; }
.upload-item .ui-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-item .ui-sub { font-size: 11px; color: var(--text-3); }
.upload-item .ui-sub.err { color: var(--red); white-space: normal; }
.upload-item .progress { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--brand-gradient); transition: width 160ms linear; }
.upload-item.error { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.upload-item .remove { margin-left: 2px; }
.drop-overlay {
  position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: var(--scrim); backdrop-filter: blur(6px);
}
.drop-overlay.show { display: grid; animation: fade-in 140ms; }
.drop-overlay .panel {
  padding: 46px 60px; border-radius: var(--radius-xl); border: 2px dashed var(--accent); background: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  text-align: center; box-shadow: 0 0 80px rgba(124, 108, 255, .35);
}
.drop-overlay .panel .icon { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--g3); }
.drop-overlay .panel b { font-size: 18px; display: block; }

/* ---- 依頼詳細・スレッド ---- */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ticket-side { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 16px; max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 4px; scrollbar-width: none; }
.ticket-side::-webkit-scrollbar { display: none; }
.ticket-head-card { padding: 22px; }
.ticket-title { font-family: var(--font-display); font-size: 22px; font-weight: 750; margin: 6px 0 10px; line-height: 1.4; word-break: break-word; }
.ticket-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ticket-body { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; line-height: 1.8; }
.target-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-2); word-break: break-all; }
.target-line .icon { width: 15px; height: 15px; flex: none; }
.action-banner {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius-lg); margin-bottom: 16px; flex-wrap: wrap;
  border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--cyan) 12%, transparent), color-mix(in srgb, var(--g1) 10%, transparent));
}
.action-banner .ab-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-gradient); color: #fff; flex: none; box-shadow: 0 8px 22px -6px rgba(34, 211, 238, .6); }
.action-banner .ab-icon .icon { width: 20px; height: 20px; }
.action-banner .ab-text { flex: 1; min-width: 200px; }
.action-banner .ab-text b { display: block; font-size: 15px; }
.action-banner .ab-text span { font-size: 12.5px; color: var(--text-2); }
.action-banner.tone-violet { border-color: color-mix(in srgb, var(--violet) 40%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--violet) 12%, transparent), transparent); }

.thread { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.msg.fresh { animation: msg-in 420ms var(--ease-spring); }
.msg.fresh .bubble { box-shadow: 0 0 0 3px var(--accent-soft); transition: box-shadow 2s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.msg .bubble { border: 1px solid var(--border); border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg); background: var(--surface); padding: 12px 16px; min-width: 0; }
.msg.own .bubble { background: var(--own-bubble); border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); }
.msg.internal .bubble { background: var(--memo-bg); border: 1px dashed var(--memo-border); }
.msg.approval .bubble { border-color: color-mix(in srgb, var(--green) 45%, transparent); background: color-mix(in srgb, var(--green) 8%, transparent); }
.msg.revision .bubble { border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 7%, transparent); }
.msg .m-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 4px; }
.msg .m-head b { font-weight: 700; }
.msg .m-head time { color: var(--text-3); font-size: 12px; }
.msg .m-body { white-space: pre-wrap; word-break: break-word; line-height: 1.75; }
.msg .m-files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.sys-event { display: flex; align-items: center; gap: 10px; padding-left: 12px; font-size: 12.5px; color: var(--text-3); }
.sys-event .line { width: 24px; height: 1px; background: var(--border-strong); }
.sys-event .icon { width: 14px; height: 14px; }
.sys-event.internal { color: color-mix(in srgb, var(--amber) 80%, var(--text-3)); }
.thread-day { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--text-3); font-weight: 650; letter-spacing: .06em; margin: 6px 0; }
.thread-day::before, .thread-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.avatar {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 750; font-size: 13px; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--av-a, #7c6cff), var(--av-b, #22d3ee)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset;
}
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.avatar.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 10px; }
.avatar.client { --av-a: #f472b6; --av-b: #fb923c; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.composer { margin-top: 18px; padding: 14px; border-radius: var(--radius-lg); }
.composer .textarea { min-height: 96px; border: 0; background: transparent; padding: 6px 4px; box-shadow: none; resize: none; }
.composer .textarea:focus { box-shadow: none; }
.composer.internal { border-color: var(--memo-border); background: var(--memo-bg); }
.composer-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; }
.composer-foot .grow { flex: 1; }
.composer-foot .select { height: 34px; width: auto; font-size: 12.5px; }
.composer-hint { font-size: 11.5px; color: var(--text-3); }

/* ファイル表示 */
.file-tile {
  position: relative; width: 168px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-solid-2); overflow: hidden;
  cursor: pointer; transition: transform var(--dur) var(--ease), border-color var(--dur); color: var(--text);
}
.file-tile:hover { transform: translateY(-2px); border-color: var(--border-strong); text-decoration: none; }
.file-tile .ft-preview { height: 104px; display: grid; place-items: center; background: var(--surface-2); position: relative; overflow: hidden; }
.file-tile .ft-preview img, .file-tile .ft-preview video { width: 100%; height: 100%; object-fit: cover; }
.file-tile .ft-preview .icon { width: 30px; height: 30px; color: var(--text-3); }
.file-tile .ft-preview .ext { position: absolute; bottom: 8px; right: 8px; font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 6px; border-radius: 5px; background: rgba(0, 0, 0, .55); color: #fff; text-transform: uppercase; }
.file-tile .ft-preview .play { position: absolute; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(4px); }
.file-tile .ft-preview .play .icon { width: 16px; height: 16px; color: #fff; margin-left: 2px; }
.file-tile .ft-info { padding: 8px 10px; }
.file-tile .ft-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-tile .ft-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.file-grid .file-tile { width: auto; }
.file-grid .file-tile .ft-preview { height: 132px; }

/* ---- 素材依頼 ---- */
.asset-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); align-items: start; }
.asset-item:last-child { border-bottom: 0; }
.asset-check { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--border-strong); display: grid; place-items: center; margin-top: 2px; }
.asset-check .icon { width: 14px; height: 14px; }
.asset-item.submitted .asset-check { border-color: var(--cyan); color: var(--cyan); }
.asset-item.accepted .asset-check { border: 0; background: linear-gradient(135deg, #34d399, #22d3ee); color: #04120c; }
.asset-item .a-title { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.asset-item .a-desc { font-size: 13px; color: var(--text-2); margin-top: 4px; white-space: pre-wrap; }
.asset-item .a-note { font-size: 12.5px; color: var(--text-2); margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; }
.asset-item .a-meta { font-size: 12px; color: var(--text-3); margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.asset-item .a-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.asset-progress { display: flex; align-items: center; gap: 14px; }
.asset-progress .meter { flex: 1; height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; display: flex; }
.asset-progress .meter i { display: block; height: 100%; }
.asset-progress .meter i.acc { background: linear-gradient(90deg, #34d399, #22d3ee); }
.asset-progress .meter i.sub { background: color-mix(in srgb, var(--cyan) 50%, transparent); }

/* ---- カンバン ---- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.k-col { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); min-height: 200px; display: flex; flex-direction: column; }
.k-col-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; }
.k-col-head .count { font-size: 12px; color: var(--text-3); font-weight: 700; }
.k-cards { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 12px; }
.k-card { display: block; padding: 12px 13px; border-radius: 13px; background: var(--surface-solid-2); border: 1px solid var(--border); color: var(--text); transition: transform var(--dur) var(--ease), border-color var(--dur); }
.k-card:hover { transform: translateY(-2px); border-color: var(--border-strong); text-decoration: none; }
.k-card .kc-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.k-card .kc-title { font-weight: 650; font-size: 13.5px; line-height: 1.5; }
.k-card .kc-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }

/* ---- タイムライン ---- */
.timeline { position: relative; padding-left: 8px; }
.tl-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 10px 0; }
.tl-item::before { content: ""; position: absolute; left: 13px; top: 38px; bottom: -10px; width: 1px; background: var(--border-strong); }
.tl-item:last-child::before { display: none; }
.tl-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.tl-icon .icon { width: 14px; height: 14px; }
.tl-icon.tone { color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); border-color: color-mix(in srgb, var(--tone) 30%, transparent); }
.tl-text { font-size: 13px; line-height: 1.6; padding-top: 3px; word-break: break-word; }
.tl-text b { font-weight: 650; }
.tl-text .tl-time { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.tl-text .tl-sub { display: block; font-size: 12px; color: var(--text-3); }
.tl-item.internal .tl-icon { border-style: dashed; border-color: var(--memo-border); }

/* ---- 空状態・スケルトン ---- */
.empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty .e-art { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .e-art .icon { width: 28px; height: 28px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 0 16px; font-size: 13px; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); animation: sheen 1.3s infinite; }
.sk-line { height: 14px; margin: 10px 0; }
.sk-block { height: 120px; border-radius: var(--radius-lg); }

/* ---- ポップオーバー・メニュー ---- */
.popover {
  position: fixed; z-index: 80; min-width: 240px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent); backdrop-filter: blur(20px) saturate(160%); box-shadow: var(--shadow-lg);
  animation: pop-in 160ms var(--ease); overflow: hidden;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu { padding: 6px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--text); font-size: 13.5px; }
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item .icon { width: 16px; height: 16px; color: var(--text-2); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.menu-head .sub { font-size: 12px; color: var(--text-3); }

.notif-panel { width: 400px; max-width: calc(100vw - 24px); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-head b { font-size: 14px; }
.notif-list { max-height: min(70vh, 520px); overflow-y: auto; }
.notif { display: grid; grid-template-columns: 28px minmax(0, 1fr) 8px; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); cursor: pointer; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif .n-text { font-size: 13px; line-height: 1.55; }
.notif .n-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.notif.read { opacity: .62; }

/* ---- モーダル ---- */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: var(--scrim); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; animation: fade-in 160ms; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(640px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: var(--radius-xl); border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface-solid) 96%, transparent); box-shadow: var(--shadow-lg); animation: modal-in 240ms var(--ease-spring);
}
.modal.wide { width: min(860px, 100%); }
.modal.narrow { width: min(440px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 750; font-family: var(--font-display); }
.modal-body { padding: 8px 22px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--border); }
.secret-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--accent); background: var(--accent-soft); font-family: var(--mono); font-size: 16px; letter-spacing: .05em; word-break: break-all; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.notice .icon { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--accent); }
.notice.warn .icon { color: var(--amber); }

/* ---- コマンドパレット ---- */
.palette-backdrop { position: fixed; inset: 0; z-index: 75; background: var(--scrim); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade-in 120ms; }
.palette { width: min(640px, 100%); border-radius: var(--radius-xl); border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface-solid) 94%, transparent); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124, 108, 255, .15); overflow: hidden; animation: modal-in 200ms var(--ease-spring); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.palette-input .icon { width: 20px; height: 20px; color: var(--accent); }
.palette-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; }
.palette-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.palette-group { font-size: 11px; color: var(--text-3); letter-spacing: .1em; padding: 10px 10px 6px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; cursor: pointer; color: var(--text); }
.palette-item .icon { width: 17px; height: 17px; color: var(--text-2); }
.palette-item .pi-sub { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.palette-item.active { background: var(--accent-soft); }
.palette-item.active .icon { color: var(--accent); }
.palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }

/* ---- ライトボックス ---- */
.lightbox { position: fixed; inset: 0; z-index: 85; background: rgba(2, 4, 10, .92); display: grid; grid-template-rows: auto 1fr auto; animation: fade-in 160ms; color: #fff; }
.lb-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.lb-bar .lb-name { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar .lb-count { font-size: 12px; color: rgba(255, 255, 255, .6); }
.lb-bar .icon-btn { color: rgba(255, 255, 255, .8); }
.lb-bar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 70px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 150px); border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: modal-in 220ms var(--ease); }
.lb-stage iframe { width: min(1000px, 100%); height: calc(100vh - 150px); border: 0; border-radius: 10px; background: #fff; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-nav:hover { background: rgba(255, 255, 255, .16); }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-nav .icon { width: 20px; height: 20px; }
.lb-meta { text-align: center; font-size: 12px; color: rgba(255, 255, 255, .55); padding: 12px; }
.lb-fallback { text-align: center; color: rgba(255, 255, 255, .8); }
.lb-fallback .icon { width: 56px; height: 56px; margin: 0 auto 14px; color: rgba(255, 255, 255, .6); }

/* ---- トースト ---- */
#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 95; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; min-width: 280px; max-width: 420px; padding: 13px 14px; border-radius: 14px;
  border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface-solid) 94%, transparent); backdrop-filter: blur(18px); box-shadow: var(--shadow-lg);
  animation: toast-in 300ms var(--ease-spring); cursor: default;
}
.toast.leaving { animation: toast-out 220ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }
.toast .t-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast .t-icon .icon { width: 15px; height: 15px; }
.toast.ok .t-icon { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.toast.err .t-icon { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.toast.info .t-icon { background: var(--accent-soft); color: var(--accent); }
.toast .t-text { font-size: 13px; line-height: 1.55; padding-top: 2px; }
.toast .t-text b { display: block; }
.toast.clickable { cursor: pointer; }

/* ---- ログイン ---- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero { position: relative; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border-right: 1px solid var(--border); }
.auth-hero h1 { font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 46px); line-height: 1.22; font-weight: 800; margin: 0 0 18px; letter-spacing: .01em; }
.auth-hero p { color: var(--text-2); font-size: 15px; max-width: 480px; margin: 0; }
.hero-visual { position: relative; margin: 40px 0; display: grid; gap: 12px; max-width: 460px; }
.hero-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(12px); box-shadow: var(--shadow); animation: float 6s ease-in-out infinite; }
.hero-card:nth-child(2) { margin-left: 40px; animation-delay: -2s; }
.hero-card:nth-child(3) { margin-left: 14px; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-6px); } }
.hero-card .hc-text { flex: 1; min-width: 0; font-size: 13px; }
.hero-card .hc-text b { display: block; font-size: 13.5px; }
.hero-card .hc-text span { color: var(--text-3); font-size: 12px; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(420px, 100%); padding: 34px 32px; }
.auth-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 750; font-family: var(--font-display); }
.auth-card .lead { margin: 0 0 24px; color: var(--text-2); font-size: 13.5px; }
.auth-card form { display: grid; gap: 16px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap .icon-btn { position: absolute; right: 3px; top: 2px; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.pw-meter i { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background var(--dur); }
.pw-meter[data-score="1"] i:nth-child(-n+1) { background: var(--red); }
.pw-meter[data-score="2"] i:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-score="3"] i:nth-child(-n+3) { background: var(--cyan); }
.pw-meter[data-score="4"] i { background: var(--green); }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.auth-foot .icon { width: 14px; height: 14px; }

/* ---- グラフ ---- */
.spark { width: 100%; height: 120px; }
.spark .area { fill: url(#spark-grad); }
.spark .line-created { stroke: var(--g1); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .line-done { stroke: var(--green); fill: none; stroke-width: 2; stroke-dasharray: 4 4; stroke-linejoin: round; }
.spark .axis { fill: var(--text-3); font-size: 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.stage-bars { display: grid; gap: 10px; }
.stage-bar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 28px; gap: 10px; align-items: center; font-size: 12.5px; }
.stage-bar .sb-track { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.stage-bar .sb-fill { height: 100%; border-radius: 8px; background: var(--brand-gradient); transition: width 700ms var(--ease); }
.stage-bar .sb-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.info-list { display: grid; gap: 0; }
.info-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; }
.info-row:last-child { border-bottom: 0; }
.info-row dt { color: var(--text-3); font-size: 12px; font-weight: 600; }
.info-row dd { margin: 0; word-break: break-word; min-width: 0; }
.info-row .select, .info-row .input { height: 34px; font-size: 13px; }

.hero-project { padding: 24px; display: grid; gap: 20px; overflow: hidden; }
.hero-project .hp-top { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; }
.hero-project h1 { margin: 4px 0 6px; font-family: var(--font-display); font-size: 26px; font-weight: 780; line-height: 1.3; }
.hero-project .hp-desc { color: var(--text-2); font-size: 13.5px; max-width: 760px; white-space: pre-wrap; }
.hero-project .hp-facts { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.hero-project .hp-facts span { display: inline-flex; align-items: center; gap: 6px; }
.hero-project .hp-facts .icon { width: 14px; height: 14px; color: var(--text-3); }

.attn-list .row { grid-template-columns: auto minmax(0, 1fr) auto; }
.kv { display: flex; gap: 6px; align-items: center; }

/* ---- レスポンシブ ---- */
@media (max-width: 1180px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .ticket-layout { grid-template-columns: minmax(0, 1fr); }
  .ticket-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 960px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
@media (max-width: 860px) {
  :root { --topbar-h: 58px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 0 14px; padding-top: env(safe-area-inset-top); }
  .topbar .mobile-brand { display: flex; }
  .search-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .search-trigger .st-text, .search-trigger .kbd { display: none; }
  .content { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 21px; }
  .mobile-nav {
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px; border-radius: 20px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
    backdrop-filter: blur(20px) saturate(160%); box-shadow: var(--shadow-lg);
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 14px; font-size: 10.5px; font-weight: 650; color: var(--text-3); position: relative; }
  .mobile-nav a .icon { width: 20px; height: 20px; }
  .mobile-nav a.active { color: var(--text); background: var(--accent-soft); }
  .mobile-nav a:hover { text-decoration: none; }
  .mobile-nav a .count { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 9.5px; display: grid; place-items: center; background: var(--brand-gradient); color: #fff; }
  .form-grid { grid-template-columns: 1fr; }
  .type-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cards { grid-template-columns: 1fr; }
  .flow .node { width: 64px; }
  .flow .node .lbl { font-size: 11px; }
  .row { grid-template-columns: auto minmax(0, 1fr); padding: 13px 14px; }
  .row .r-side { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .asset-item { grid-template-columns: 26px minmax(0, 1fr); }
  .asset-item .a-actions { grid-column: 2; justify-content: flex-start; }
  .file-tile { width: 140px; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-stage { padding: 0 8px; }
  .lb-nav { display: none; }
  .kpi .kpi-value { font-size: 28px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .stage-bar { grid-template-columns: 92px minmax(0, 1fr) 24px; }
  #toast-root { left: 12px; right: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  .table .hide-sm { display: none; }
  .hero-project h1 { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media print {
  .sidebar, .topbar, .mobile-nav, .aurora, .composer { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
}
