/* YUIDAO mock — brand: white base / teal-blue gradient / mizuhiki-knot motif */

:root {
  --bg: #f4f8fb;
  --panel: #ffffff;
  --ink: #17263f;
  --muted: #62778c;
  --line: #e1ebf2;
  --teal: #12b5a5;
  --blue: #3d7bf0;
  --deep: #1f3a7a;
  --grad: linear-gradient(135deg, #19c3b1 0%, #3d7bf0 100%);
  --grad-soft: linear-gradient(135deg, rgba(25,195,177,.12), rgba(61,123,240,.12));
  --amber: #f0a13d;
  --rose: #e86a8a;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(31, 58, 122, .07);
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
}
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand .logo { width: 38px; height: 38px; flex: none; }
.brand .name { font-size: 21px; letter-spacing: .04em; }
.brand .name b { font-weight: 800; color: var(--deep); }
.brand .name span { font-weight: 300; color: var(--teal); }
.brand small { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .12em; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 14px;
  border: none; background: transparent; width: 100%; text-align: left;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--grad-soft); color: var(--ink); }
.nav-item.active { background: var(--grad); color: #fff; box-shadow: var(--shadow); }

.sidebar .foot { margin-top: auto; font-size: 11px; color: var(--muted); padding: 8px; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px; background: rgba(255,255,255,.85);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
}
.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.token-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--grad-soft); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px; font-weight: 700; color: var(--deep);
}
.token-chip .knot { width: 16px; height: 16px; }
.userchip { display: flex; align-items: center; gap: 9px; font-weight: 600; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px; flex: none;
}

.view { padding: 26px; max-width: 1120px; width: 100%; margin: 0 auto; }

/* ---------- common ---------- */
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); display: inline-block; }

.btn {
  border: none; border-radius: 10px; padding: 9px 18px;
  font-weight: 700; font-size: 13.5px;
  transition: transform .06s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: #fff; color: var(--deep); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--grad-soft); color: var(--deep);
  font-size: 11.5px; font-weight: 700; margin: 0 4px 4px 0;
}
.badge { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.badge.muni { background: #e8f2ff; color: #2b5cc4; }
.badge.member { background: #e9faf3; color: #128a5e; }
.badge.online { background: #e9faf3; color: #128a5e; }
.badge.mix { background: #fdf3e4; color: #a86a12; }
.badge.onsite { background: #fdeaef; color: #bd3b60; }

.progress { height: 8px; background: #eaf1f6; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }

/* ---------- welcome / register ---------- */
.welcome {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(600px 400px at 15% 20%, rgba(25,195,177,.14), transparent),
    radial-gradient(700px 500px at 85% 80%, rgba(61,123,240,.14), transparent),
    var(--bg);
  padding: 30px;
}
.welcome-box { width: 100%; max-width: 880px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 20px 60px rgba(31,58,122,.15); }
.welcome-hero {
  background: var(--grad); color: #fff; padding: 42px 36px;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  position: relative; overflow: hidden;
}
.welcome-hero .logo { width: 72px; height: 72px; }
.welcome-hero h1 { font-size: 34px; letter-spacing: .05em; }
.welcome-hero h1 span { font-weight: 300; }
.welcome-hero p { opacity: .92; font-size: 14px; }
.welcome-hero .circuit { position: absolute; right: -30px; bottom: -30px; opacity: .18; width: 220px; height: 220px; }
.welcome-form { background: var(--panel); padding: 38px 36px; }
.welcome-form h2 { font-size: 18px; margin-bottom: 4px; }
.welcome-form .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 12.5px; margin-bottom: 5px; color: var(--deep); }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; background: #fbfdfe; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); }
.photo-drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 18px;
  text-align: center; color: var(--muted); font-size: 12.5px; background: #fbfdfe;
}
.login-methods { display: flex; gap: 8px; margin-bottom: 18px; }
.login-methods .btn { flex: 1; font-size: 12px; padding: 9px 6px; }
.btn-line { background: #06c755; color: #fff; }

/* ---------- dashboard ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat { position: relative; overflow: hidden; }
.stat .big { font-size: 30px; font-weight: 800; color: var(--deep); }
.stat .label { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.stat .trend { color: var(--teal); font-weight: 700; font-size: 12.5px; }
.stat .bg-knot { position: absolute; right: -12px; bottom: -18px; width: 90px; height: 90px; opacity: .09; }

.proj-mini { display: flex; flex-direction: column; gap: 6px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.proj-mini:last-child { border-bottom: none; }
.proj-mini .row { display: flex; align-items: center; gap: 10px; }
.proj-mini .title { font-weight: 700; flex: 1; }
.proj-mini .pct { font-weight: 800; color: var(--deep); font-size: 13px; }

.conn { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.conn:last-child { border-bottom: none; }
.conn .info { flex: 1; min-width: 0; }
.conn .name { font-weight: 700; font-size: 13.5px; }
.conn .note { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presence { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.presence.on { background: #1fbf75; } .presence.busy { background: var(--amber); } .presence.off { background: #c3cfd9; }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; }
.rank-row.me { background: var(--grad-soft); border: 1px solid var(--line); }
.rank-row .pos { width: 30px; font-weight: 800; color: var(--muted); text-align: center; }
.rank-row .pos.top { color: var(--amber); font-size: 16px; }
.rank-row .name { flex: 1; font-weight: 700; }
.rank-row .tk { font-weight: 800; color: var(--deep); }
.rank-row .delta { font-size: 11.5px; color: var(--teal); font-weight: 700; width: 44px; text-align: right; }

/* ---------- projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.filters select, .filters input {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px;
  font: inherit; background: #fff; color: var(--ink);
}
.filters input { min-width: 220px; }
.chip-toggle { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 12.5px; color: var(--muted); }
.chip-toggle.on { background: var(--grad); border-color: transparent; color: #fff; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.proj-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: transform .12s ease, box-shadow .12s; }
.proj-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(31,58,122,.13); }
.proj-card .head { display: flex; gap: 8px; align-items: center; }
.proj-card h4 { font-size: 15px; line-height: 1.45; }
.proj-card .summary { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj-card .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.proj-card .meta b { color: var(--ink); }
.cap-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cap-bar .progress { flex: 1; }

/* ---------- project detail / workspace ---------- */
.detail-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .info { flex: 1; min-width: 280px; }
.detail-head h2 { font-size: 21px; margin: 6px 0 8px; }
.apply-box { display: flex; flex-direction: column; gap: 9px; min-width: 220px; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 22px 0 18px; }
.tab { border: none; background: none; padding: 10px 18px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; font-size: 14px; }
.tab.active { color: var(--deep); border-bottom-color: var(--teal); }

/* AI decompose */
.ai-box { background: var(--grad-soft); border: 1.5px solid rgba(25,195,177,.35); }
.ai-box .ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-box .ai-head .knot { width: 26px; height: 26px; }
.ai-input-row { display: flex; gap: 10px; }
.ai-input-row input { flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; }
.ai-result { margin-top: 14px; }
.ai-phase { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.ai-phase h5 { font-size: 13.5px; color: var(--deep); margin-bottom: 8px; }
.ai-phase li { list-style: none; display: flex; gap: 8px; align-items: baseline; font-size: 13px; padding: 3px 0; }
.ai-phase li::before { content: "◆"; color: var(--teal); font-size: 9px; }
.ai-thinking { display: flex; gap: 6px; align-items: center; color: var(--deep); font-weight: 700; font-size: 13px; margin-top: 12px; }
.ai-thinking .b { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); animation: bounce 1s infinite; }
.ai-thinking .b:nth-child(2) { animation-delay: .15s; } .ai-thinking .b:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,100% { transform: translateY(0); opacity:.5 } 50% { transform: translateY(-5px); opacity:1 } }

/* gantt */
.gantt { overflow-x: auto; }
.gantt-inner { min-width: 760px; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 220px 90px 1fr; gap: 0; align-items: center; }
.gantt-head { font-size: 11.5px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.gantt-row { padding: 8px 0; border-bottom: 1px solid #eef4f8; }
.gantt-row .t-title { font-size: 12.5px; font-weight: 700; padding-right: 10px; }
.gantt-row .t-assignee { font-size: 11.5px; color: var(--muted); }
.gantt-track { position: relative; height: 22px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100%/12 - 1px), #edf3f8 calc(100%/12 - 1px), #edf3f8 calc(100%/12)); border-radius: 6px; }
.gantt-bar { position: absolute; top: 3px; height: 16px; border-radius: 999px; background: var(--grad); opacity: .9; }
.gantt-bar.done { background: #9fb8cc; }
.gantt-bar.todo { background: #fff; border: 2px solid var(--blue); opacity: .8; }
.gantt-months { position: relative; height: 16px; font-size: 10.5px; color: var(--muted); }
.gantt-months span { position: absolute; top: 0; }

.task-status { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.task-status.done { background: #eef2f6; color: #7d93a8; }
.task-status.doing { background: #e6f7f4; color: #0e8d81; }
.task-status.todo { background: #eef4ff; color: #3d67c9; }

/* blog */
.post { padding: 16px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: none; }
.post .head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.post h4 { font-size: 15px; }
.post .meta { font-size: 12px; color: var(--muted); }
.post .body { font-size: 13.5px; margin: 6px 0 8px; }
.like-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--rose); }
.like-btn.liked { background: #fdeaef; border-color: #f3c2d0; }

/* ---------- YUIDAO-chan chat ---------- */
.chat-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 60;
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--grad); border: none; box-shadow: 0 10px 28px rgba(31,58,122,.3);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab svg { width: 34px; height: 34px; }

.chat-panel {
  position: fixed; right: 26px; bottom: 100px; z-index: 60;
  width: 340px; max-width: calc(100vw - 40px); height: 460px;
  background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(31,58,122,.28);
  display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--line);
}
.chat-panel.open { display: flex; }
.chat-head { background: var(--grad); color: #fff; padding: 13px 16px; display: flex; align-items: center; gap: 10px; }
.chat-head .knot { width: 30px; height: 30px; }
.chat-head .t { font-weight: 800; }
.chat-head .s { font-size: 11px; opacity: .9; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f7fafc; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.msg.bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; background: #f7fafc; }
.chat-suggest button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 11.5px; color: var(--deep); font-weight: 700; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-input input { flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 14px; font: inherit; }
.chat-input button { border: none; background: var(--grad); color: #fff; border-radius: 999px; width: 40px; font-weight: 800; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--deep); color: #fff; padding: 11px 22px; border-radius: 999px;
  font-weight: 700; font-size: 13px; opacity: 0; pointer-events: none;
  transition: all .25s ease; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.mock-note {
  background: #fff8e8; border: 1px solid #f3e2b3; color: #8a6d1f;
  border-radius: 10px; padding: 8px 14px; font-size: 12px; margin-bottom: 18px;
}

/* responsive */
@media (max-width: 900px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 14px 8px; }
  .brand .name, .brand small, .nav-item span, .sidebar .foot { display: none; }
  .nav-item { justify-content: center; }
  .cols-2, .cols-3, .stat-row { grid-template-columns: 1fr; }
  .welcome-box { grid-template-columns: 1fr; }
}

/* ---------- v0.2 additions ---------- */

/* greeting with YUIDAO-chan */
.greet { display: flex; gap: 16px; align-items: center; }
.greet .bubble {
  position: relative; flex: 1;
  background: var(--grad-soft); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; font-size: 13.5px;
}
.greet .bubble::before {
  content: ""; position: absolute; left: -7px; top: 26px;
  width: 12px; height: 12px; background: inherit;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: rotate(45deg); background: #eef7f9;
}

/* japan map */
.jp-map { background: linear-gradient(180deg, #eaf4fb, #f2f9fc); border-radius: 14px; }
.jp-land { fill: #d7e8f3; stroke: #b3d0e2; stroke-width: 1.5; }
.jp-txt { font-size: 9px; fill: #7d97ab; text-anchor: middle; font-weight: 700; }
.jp-pin-label { font-size: 10px; fill: #17263f; text-anchor: middle; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 3; }
.map-pin:hover circle { filter: brightness(1.1); }
.map-toggle { display: flex; gap: 6px; }

/* group chat */
.gc { display: flex; flex-direction: column; gap: 12px; max-height: 400px; overflow-y: auto; padding: 6px 2px; }
.gc-msg { display: flex; gap: 9px; align-items: flex-start; }
.gc-msg.me { flex-direction: row-reverse; }
.gc-bubble {
  background: #f4f8fb; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 13px; font-size: 13px; max-width: 480px; margin-top: 3px;
}
.gc-msg.me .gc-bubble { background: var(--grad); color: #fff; border: none; }
.gc-org {
  display: inline-block; background: #e8f2ff; color: #2b5cc4;
  font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 5px; margin-left: 4px;
}

/* legal check */
.legal-warn {
  background: #fdf0ec; border: 1.5px solid #f0c6ba; color: #a04a33;
  border-radius: 12px; padding: 12px 16px; font-size: 12.5px; font-weight: 600;
  margin-top: 12px; line-height: 1.7;
}

/* modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(23, 38, 63, .45);
  z-index: 90; display: flex; align-items: center; justify-content: center; padding: 22px;
}
.modal-card {
  background: #fff; border-radius: 18px; max-width: 560px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}

/* analytics bars */
.bar-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.bar-row .lbl { width: 190px; font-size: 12.5px; font-weight: 700; flex: none; }
.bar-row .bar { flex: 1; height: 10px; background: #eaf1f6; border-radius: 999px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.bar-row .v { width: 42px; text-align: right; font-weight: 800; font-size: 12px; color: var(--deep); flex: none; }

/* nav section label */
.nav-label { font-size: 10px; color: var(--muted); letter-spacing: .12em; padding: 14px 12px 4px; font-weight: 800; }
@media (max-width: 900px) { .nav-label { display: none; } }

/* PR / ads (v0.3) */
.badge.pr { background: linear-gradient(135deg, #f7b733, #f0803d); color: #fff; }
.ad-banner {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: #fff; border: 1.5px dashed #e7c98a; border-radius: 12px;
  padding: 10px 16px; margin-bottom: 18px; font-size: 13px;
}
.ad-banner:hover { border-color: var(--amber); }
.ad-mark { background: #f3e6c8; color: #8a6d1f; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 5px; flex: none; }
.ad-text { font-weight: 700; flex: 1; }
