:root {
  --ink: #172b4d;
  --muted: #626f86;
  --blue: #1868db;
  --blue-dark: #0c3b7c;
  --surface: #ffffff;
  --canvas: #f7f8fa;
  --line: #dfe1e6;
  --sidebar: 264px;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font-family: "Noto Sans JP", sans-serif; background: var(--canvas); }
button, input, textarea { font: inherit; }
.d-none { display: none !important; }

.loading-view { min-height: 100vh; display: flex; gap: 18px; align-items: center; justify-content: center; background: #fff; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; color: #fff; background: var(--blue); border-radius: 10px 10px 10px 3px; font-weight: 800; font-size: 18px; box-shadow: 0 6px 16px rgba(24,104,219,.2); }
.brand-light { color: #fff; }
.brand-light .brand-mark { background: #fff; color: var(--blue); }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 2.1px; margin-bottom: 16px; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(480px, 1.08fr) minmax(440px, .92fr); background: #fff; }
.login-copy { color: #fff; padding: 42px 7vw; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; background: linear-gradient(145deg, #0b2f64, #0e4c9d 60%, #176dde); }
.login-copy::after { content:""; position:absolute; width:500px; height:500px; border-radius:50%; border:1px solid rgba(255,255,255,.1); right:-230px; bottom:-160px; box-shadow: 0 0 0 90px rgba(255,255,255,.025), 0 0 0 180px rgba(255,255,255,.02); }
.login-message { position: relative; z-index: 1; max-width: 680px; padding: 60px 0 30px; }
.login-message h1 { font-size: clamp(42px, 5vw, 70px); line-height: 1.22; letter-spacing: -3px; font-weight: 800; margin: 0 0 24px; }
.login-message h1 em { font-style: normal; color: #7bb6ff; }
.login-message p { color: #c9ddf8; font-size: 16px; line-height: 1.9; }
.login-copy small { color: #a8c4e8; z-index: 1; }
.mini-board { display: flex; gap: 12px; width: 520px; padding: 18px; margin-top: 48px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; transform: rotate(-1.5deg); backdrop-filter: blur(8px); }
.mini-column { flex: 1; padding: 12px; border-radius: 9px; background: rgba(255,255,255,.1); }
.mini-column.featured { transform: translateY(-8px); background: rgba(255,255,255,.16); }
.mini-column span { display: block; color: #cce1ff; font-size: 8px; font-weight: 700; letter-spacing: 1px; margin-bottom: 12px; }
.mini-column i { display: block; height: 44px; background: #fff; opacity: .92; border-radius: 6px; margin: 7px 0; }
.login-panel { display: grid; place-items: center; padding: 48px; }
.login-card { width: min(420px, 100%); }
.login-card h2 { font-weight: 800; font-size: 32px; letter-spacing: -1.2px; margin: 0 0 16px; }
.login-card > p { color: var(--muted); font-size: 14px; line-height: 1.8; margin-bottom: 30px; }
.google-button { width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; gap: 14px; border: 1px solid #c7ccd4; border-radius: 7px; color: var(--ink); font-weight: 600; text-decoration: none; background: white; transition: .15s; }
.google-button:hover { border-color: #8c96a8; box-shadow: 0 4px 12px rgba(9,30,66,.12); transform: translateY(-1px); }
.google-logo { font-family: Arial,sans-serif; font-size: 20px; font-weight: 700; color: #4285f4; }
.security-note { text-align: center; color: #7b879b; font-size: 11px; margin-top: 20px; }
.security-note span { color: #22a06b; margin-right: 4px; }
.mobile-brand { display: none; }

.app-shell { min-height: 100vh; }
.topbar { height: 64px; padding: 0 22px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; position: fixed; z-index: 30; inset: 0 0 auto; }
.topbar .brand { width: calc(var(--sidebar) - 22px); }
.topbar-search { position: relative; width: 340px; height: 38px; display:flex; align-items:center; border: 1px solid #c7ccd4; border-radius: 7px; color: #7b879b; padding: 0 10px; }
.topbar-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(24,104,219,.12); }
.topbar-search input { border: 0; outline: 0; width:100%; padding:0 8px; font-size: 13px; background: transparent; }
.topbar-search kbd { color: #7b879b; background: #f1f2f4; font-size: 10px; border: 1px solid #dfe1e6; }
.topbar-actions { margin-left:auto; display:flex; align-items:center; gap:10px; }
.icon-button { border:0; background:transparent; width:34px; height:34px; border-radius:50%; color:#44546f; }
.icon-button:hover { background:#f1f2f4; }
.avatar-button { width:34px; height:34px; padding:0; border:0; background:#dfe1e6; border-radius:50%; overflow:hidden; }
.avatar-button img { width:100%; height:100%; object-fit:cover; }
.mobile-only { display:none; }

.sidebar { width: var(--sidebar); position: fixed; z-index:20; top:64px; bottom:0; padding:20px 14px; background:#fff; border-right:1px solid var(--line); display:flex; flex-direction:column; }
.sidebar nav { display:flex; flex-direction:column; gap:4px; }
.nav-item, .space-link { width:100%; border:0; background:transparent; display:flex; align-items:center; gap:12px; text-align:left; border-radius:7px; color:#44546f; font-size:13px; font-weight:600; min-height:40px; padding:8px 12px; }
.nav-item:hover,.space-link:hover { background:#f1f2f4; }
.nav-item.active { color:#0c66e4; background:#e9f2ff; }
.nav-item > span { width:18px; text-align:center; font-size:18px; }
.sidebar-section { margin-top:24px; overflow:hidden; }
.section-label { color:#7b879b; font-size:10px; letter-spacing:.8px; font-weight:800; padding:0 8px 8px 12px; display:flex; justify-content:space-between; align-items:center; }
.section-label button { border:0; background:transparent; color:#7b879b; font-size:18px; border-radius:4px; }
.section-label button:hover { color:var(--blue); background:#e9f2ff; }
.space-link .space-icon { width:25px; height:25px; color:#fff; display:grid; place-items:center; border-radius:6px; font-size:10px; flex:none; }
.space-link span:last-child { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-collapse { margin-top:auto; border:0; border-top:1px solid var(--line); background:transparent; color:#626f86; font-size:12px; text-align:left; padding:17px 12px 0; }
.sidebar-collapse span { margin-left:9px; }
.sidebar-backdrop { display:none; }
.content { margin-left:var(--sidebar); padding:64px 0 0; min-height:100vh; }

.page { padding: 38px 46px 64px; max-width: 1400px; margin:0 auto; }
.page-wide { max-width:none; }
.breadcrumbs { color:#626f86; font-size:12px; display:flex; gap:8px; align-items:center; margin-bottom:18px; }
.breadcrumbs button { border:0; background:transparent; padding:0; color:#626f86; }
.breadcrumbs button:hover { color:var(--blue); }
.page-heading { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; margin-bottom:32px; }
.page-heading h1 { font-size:28px; font-weight:800; letter-spacing:-.8px; margin:0 0 9px; }
.page-heading p { color:var(--muted); font-size:13px; margin:0; }
.btn-primary { background:var(--blue); border-color:var(--blue); font-weight:600; font-size:13px; }
.btn-primary:hover { background:#0c66e4; border-color:#0c66e4; }
.btn-light { background:#f1f2f4; border-color:#f1f2f4; color:#172b4d; font-weight:600; font-size:13px; }

.welcome-card { display:grid; grid-template-columns:1.3fr .7fr; min-height:220px; overflow:hidden; background:linear-gradient(120deg,#0c3b7c,#1456af); border-radius:14px; color:#fff; margin-bottom:34px; }
.welcome-copy { padding:40px; position:relative; z-index:1; }
.welcome-copy h1 { font-size:32px; font-weight:800; letter-spacing:-1px; margin-bottom:14px; }
.welcome-copy p { color:#c9ddf8; font-size:14px; line-height:1.8; max-width:600px; }
.welcome-art { position:relative; overflow:hidden; }
.welcome-art::before,.welcome-art::after { content:""; position:absolute; border:1px solid rgba(255,255,255,.16); border-radius:50%; width:300px;height:300px; right:-50px;top:-110px; }
.welcome-art::after { width:220px;height:220px;right:40px;top:70px; background:rgba(255,255,255,.04); }
.section-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.section-heading h2 { font-size:17px; font-weight:700; margin:0; }
.section-heading button { border:0; background:transparent; color:var(--blue); font-size:12px; font-weight:600; }

.space-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.space-card,.board-card { border:1px solid var(--line); background:#fff; border-radius:10px; transition:.15s; overflow:hidden; }
.space-card { padding:20px; cursor:pointer; min-height:154px; display:flex; flex-direction:column; }
.space-card:hover,.board-card:hover { border-color:#9fadbc; box-shadow:0 5px 18px rgba(9,30,66,.09); transform:translateY(-1px); }
.space-card-top { display:flex; align-items:center; gap:12px; margin-bottom:17px; }
.space-card-icon { width:40px;height:40px;border-radius:9px;color:#fff;display:grid;place-items:center;font-size:13px;font-weight:800; }
.space-card h3 { font-size:15px;font-weight:700;margin:0 0 3px; }
.space-card .key { color:#7b879b;font-size:10px;font-weight:700;letter-spacing:.7px; }
.space-card p { font-size:12px;color:#626f86;line-height:1.6;margin:0 0 15px; }
.space-card footer { margin-top:auto;color:#7b879b;font-size:11px;display:flex;justify-content:space-between; }
.empty-state { padding:70px 20px; border:1px dashed #b6bfcc; border-radius:12px; text-align:center; background:#fff; }
.empty-icon { width:58px;height:58px;display:grid;place-items:center;margin:0 auto 16px;border-radius:16px;background:#e9f2ff;color:var(--blue);font-size:25px; }
.empty-state h3 { font-size:17px;font-weight:700; }
.empty-state p { color:var(--muted);font-size:13px; }

.space-hero { padding:30px 34px; color:#fff; border-radius:12px; margin-bottom:28px; display:flex; align-items:center; justify-content:space-between; position:relative;overflow:hidden; }
.space-hero::after { content:"";width:190px;height:190px;border-radius:50%;border:1px solid rgba(255,255,255,.2);position:absolute;right:-40px;top:-70px; }
.space-hero h1 { font-size:27px;font-weight:800;margin:0 0 6px; }
.space-hero p { color:rgba(255,255,255,.78);font-size:12px;margin:0;max-width:600px; }
.space-hero .space-key { display:inline-block;font-size:10px;letter-spacing:1.4px;font-weight:800;margin-bottom:11px;opacity:.8; }
.board-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px; }
.board-card { min-height:142px;padding:20px;cursor:pointer;display:flex;flex-direction:column; }
.board-card h3 { font-size:15px;font-weight:700;margin:0 0 8px; }
.board-card p { color:#626f86;font-size:12px;line-height:1.6;margin:0; }
.board-card footer { margin-top:auto;display:flex;align-items:center;justify-content:space-between;color:#7b879b;font-size:11px; }
.board-card .list-count { background:#f1f2f4;border-radius:10px;padding:3px 8px; }

.board-page { min-height:calc(100vh - 64px); display:flex; flex-direction:column; padding-bottom:0; }
.board-page .page-heading { margin-bottom:22px; }
.board-tools { display:flex;align-items:center;gap:8px; }
.board-canvas { margin:0 -46px; padding:22px 46px 45px; background:#f1f2f4; flex:1; overflow-x:auto; border-top:1px solid #dfe1e6; }
.lists-row { display:flex; align-items:flex-start; gap:14px; min-width:max-content; }
.kanban-list { width:290px; background:#fff; border:1px solid #dfe1e6; border-radius:10px; box-shadow:0 1px 2px rgba(9,30,66,.08); overflow:hidden; }
.kanban-list.sortable-ghost { opacity:.35; }
.list-header { display:flex;align-items:center;gap:8px;padding:15px 15px 12px;cursor:grab; }
.list-header:active { cursor:grabbing; }
.list-handle { color:#a5adba;letter-spacing:-2px; }
.list-title { font-size:12px;font-weight:800;letter-spacing:.5px;margin:0;flex:1;text-transform:uppercase; }
.list-count { font-size:10px;color:#7b879b;background:#f1f2f4;border-radius:10px;padding:2px 7px; }
.list-menu { border:0;background:transparent;color:#626f86;border-radius:5px;width:28px;height:28px; }
.list-menu:hover { background:#f1f2f4; }
.list-body { min-height:130px;padding:0 12px 12px; }
.kanban-card { position:relative;background:#fff;border:1px solid #dfe1e6;border-radius:7px;padding:10px 38px 10px 11px;margin-bottom:8px;box-shadow:0 1px 2px rgba(9,30,66,.08);cursor:pointer; }
.kanban-card.is-subtask { margin-left:14px;border-left:3px solid #579dff;padding-left:10px; }
.kanban-card.is-subtask::before { content:"";position:absolute;left:-15px;top:18px;width:12px;height:12px;border-left:1px solid #b6c2cf;border-bottom:1px solid #b6c2cf;border-radius:0 0 0 5px; }
.kanban-card:hover { border-color:#85b8ff;box-shadow:0 2px 5px rgba(9,30,66,.14); }
.card-menu-wrap { position:absolute;top:6px;right:6px; }
.card-menu { display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:5px;background:transparent;color:#626f86;font-size:13px;letter-spacing:-1px;opacity:0; }
.kanban-card:hover .card-menu,.card-menu:focus,.card-menu[aria-expanded="true"] { opacity:1; }
.card-menu:hover,.card-menu:focus { background:#f1f2f4;color:#172b4d;outline:0; }
@media (hover:none) { .card-menu { opacity:1; } }
.kanban-card.sortable-chosen { cursor:grabbing;transform:rotate(1deg); }
.kanban-card.sortable-ghost { opacity:.35; }
.kanban-card.sortable-drag { box-shadow:0 8px 20px rgba(9,30,66,.2); }
.card-type { display:inline-block;margin-bottom:6px;padding:2px 6px;border-radius:4px;background:#e9f2ff;color:#0c66e4;font-size:9px;font-weight:700; }
.kanban-card h3 { margin:0;font-size:13px;line-height:1.4;color:#172b4d; }
.card-relation { display:flex;align-items:center;gap:7px;width:100%;margin-top:8px;padding:6px 7px;border:0;border-radius:5px;background:#f1f2f4;color:#44546f;text-align:left;font-size:11px;line-height:1.2; }
.card-relation small { display:block;margin-bottom:2px;color:#7b879b;font-size:8px;font-weight:700;letter-spacing:.35px;text-transform:uppercase; }
.relation-icon { flex:0 0 auto;color:#0c66e4;font-size:14px;font-weight:700; }
.subtask-count { width:max-content;padding-right:10px;background:#e9f2ff;color:#0c66e4; }
.kanban-card p { margin:6px 0 0;font-size:11px;line-height:1.45;color:#626f86;white-space:pre-wrap; }
.card-dates { margin-top:8px;font-size:10px;color:#626f86; }
.card-detail-grid { display:grid;grid-template-columns:110px 1fr;gap:12px;margin:0; }
.card-detail-grid > label,.parent-task-row > label { color:#626f86;font-size:12px;font-weight:600;align-self:center; }
.parent-task-row { display:contents; }
.inline-card-title,.inline-card-field,.inline-card-description { width:100%;border:1px solid transparent;border-radius:5px;background:transparent;color:#172b4d;transition:background .15s,border-color .15s,box-shadow .15s; }
.inline-card-title { padding:3px 6px;margin-left:-6px;font-size:1.25rem;font-weight:600; }
.inline-card-field { padding:6px 8px;font-size:13px; }
.inline-card-description { padding:8px;margin:-8px;resize:vertical;font-size:13px;line-height:1.5; }
.inline-card-title:hover,.inline-card-field:hover,.inline-card-description:hover { background:#f1f2f4; }
.inline-card-title:focus,.inline-card-field:focus,.inline-card-description:focus { outline:0;background:#fff;border-color:#0c66e4;box-shadow:0 0 0 1px #0c66e4; }
.inline-save-state { margin-left:8px;color:#22a06b;font-size:10px;font-weight:600; }
.card-detail-description { margin-top:20px;padding-top:16px;border-top:1px solid #ebecf0; }
.card-detail-description > span { display:block;margin-bottom:7px;color:#626f86;font-size:12px;font-weight:600; }
.card-detail-description p,.card-detail-description ul { margin:0;color:#172b4d;font-size:13px;white-space:pre-wrap; }
.list-placeholder { padding:22px 10px;text-align:center;color:#97a0af;font-size:11px;border:1px dashed #dfe1e6;border-radius:7px; }
.list-footer { display:block;width:100%;border:0;border-top:1px solid #ebecf0;background:#fafbfc;text-align:left;padding:12px 16px;color:#626f86;font-size:11px; }
.list-footer:hover { background:#f1f2f4;color:#172b4d; }
.new-list-button { width:290px; border:1px dashed #aeb8c5; background:rgba(255,255,255,.6); border-radius:10px; padding:14px; color:#44546f; font-size:12px; font-weight:600; text-align:left; }
.new-list-button:hover { background:#fff;border-color:#7b879b; }

.space-tabs { display:flex;gap:4px;margin-top:24px;border-bottom:1px solid #dfe1e6; }
.space-tab { border:0;border-bottom:3px solid transparent;background:transparent;padding:11px 16px;color:#626f86;font-size:13px;font-weight:700; }
.space-tab:hover { color:#0c66e4;background:#f7f8f9; }
.space-tab.active { color:#0c66e4;border-bottom-color:#0c66e4; }
.space-tab span { margin-left:5px;padding:2px 6px;border-radius:10px;background:#f1f2f4;font-size:10px; }
.documents-layout { display:grid;grid-template-columns:240px minmax(0,1fr);gap:20px;align-items:start; }
.document-picker { position:sticky;top:20px;border:1px solid #dfe1e6;border-radius:10px;background:#fff;padding:12px; }
.document-picker h2 { margin:2px 6px 10px;font-size:12px;color:#44546f; }
.document-option { display:flex;align-items:center;gap:9px;padding:9px 8px;border-radius:6px;color:#172b4d;font-size:12px;cursor:pointer; }
.document-option:hover { background:#f1f2f4; }
.document-option input { accent-color:#0c66e4; }
.document-empty { margin:8px;color:#7b879b;font-size:11px; }
.document-editors { display:grid;gap:18px;min-width:0; }
.document-editor { overflow:hidden;border:1px solid #dfe1e6;border-radius:10px;background:#fff;box-shadow:0 1px 2px rgba(9,30,66,.08); }
.document-editor header { display:flex;align-items:center;gap:12px;padding:12px;border-bottom:1px solid #ebecf0; }
.document-title { flex:1;border:1px solid transparent;border-radius:5px;padding:6px 8px;font-size:15px;font-weight:700;color:#172b4d; }
.document-title:hover { background:#f1f2f4; }
.document-title:focus { outline:0;border-color:#0c66e4;background:#fff;box-shadow:0 0 0 1px #0c66e4; }
.document-delete { border:0;background:transparent;color:#ae2e24;font-size:11px; }
.document-markdown { display:block;width:100%;min-height:330px;border:0;outline:0;padding:18px;resize:vertical;background:#fbfcfd;color:#172b4d;font:12px/1.65 Consolas,Monaco,monospace; }
.document-editor footer { display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-top:1px solid #ebecf0; }
.document-editor footer span { color:#7b879b;font-size:10px;text-transform:uppercase;letter-spacing:.8px; }
.document-selection-empty { padding:70px 24px;border:1px dashed #c7d1df;border-radius:10px;text-align:center;color:#7b879b;font-size:12px; }

.modal-content { border:0;border-radius:12px;box-shadow:0 18px 50px rgba(9,30,66,.22); }
.modal-header { padding:25px 27px 15px;border-bottom:0;align-items:flex-start; }
.modal-title { font-size:20px;font-weight:800;letter-spacing:-.5px; }
.modal-header .eyebrow { margin-bottom:6px; }
.modal-body { padding:12px 27px 22px; }
.modal-footer { border-top:1px solid #ebecf0;padding:16px 27px; }
.form-label { font-size:12px;font-weight:700;color:#44546f; }
.form-control { border-color:#b6bfcc;font-size:13px;padding:10px 12px; }
.form-control:focus { border-color:var(--blue);box-shadow:0 0 0 2px rgba(24,104,219,.13); }
.color-picker-row { display:flex;gap:10px; }
.color-option { width:30px;height:30px;border:3px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #dfe1e6;cursor:pointer; }
.color-option.active { box-shadow:0 0 0 2px var(--ink); }

@media (max-width: 980px) {
  .space-grid,.board-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .login-view { grid-template-columns:1fr; }
  .login-copy { display:none; }
  .login-panel { min-height:100vh; }
  .mobile-brand { display:flex;align-items:center;gap:10px;font-size:20px;font-weight:800;margin-bottom:55px; }
}
@media (max-width: 760px) {
  .topbar { padding:0 14px;gap:10px; }
  .topbar .brand { width:auto; }
  .topbar .brand > span:last-child { display:none; }
  .topbar-search { flex:1;width:auto; }
  .topbar-search kbd { display:none; }
  .mobile-only { display:block; }
  .sidebar { transform:translateX(-100%);transition:.2s;box-shadow:5px 0 20px rgba(9,30,66,.15); }
  .sidebar.open { transform:translateX(0); }
  .sidebar-backdrop.open { display:block;position:fixed;inset:64px 0 0;z-index:19;background:rgba(9,30,66,.35); }
  .content { margin-left:0; }
  .page { padding:26px 18px 48px; }
  .page-heading { flex-direction:column; }
  .space-grid,.board-grid { grid-template-columns:1fr; }
  .welcome-card { grid-template-columns:1fr; }
  .welcome-copy { padding:28px; }
  .welcome-copy h1 { font-size:25px; }
  .welcome-art { display:none; }
  .space-hero { padding:25px; }
  .documents-layout { grid-template-columns:1fr; }
  .document-picker { position:static; }
  .board-canvas { margin:0 -18px;padding:18px; }
  .kanban-list,.new-list-button { width:270px; }
}
