/* MyScape — collab: projects, kanban, chat, meetings (Apple light) */

/* ---------- ghost state ---------- */
.ghost-banner {
  max-width: 900px; margin: 0 auto 18px; padding: 14px 18px;
  background: #f0f0f2; border: 1px dashed #b9b9c0; border-radius: 14px;
  color: #4a4a52; font-size: 13px; line-height: 1.6;
}

/* ---------- seed kits (harness proposal) ---------- */
.kit-modal { max-width: 560px; width: 100%; text-align: left; }
.kit-sub { color: var(--text-2); font-size: 13px; margin: -6px 0 16px; }
.kit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.kit-card {
  text-align: left; padding: 12px; border-radius: 14px; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--line); font-family: inherit;
  display: flex; flex-direction: column; gap: 4px; transition: border-color .15s ease, background .15s ease;
}
.kit-card:hover { border-color: var(--accent); }
.kit-card.sel { border-color: var(--accent); background: rgba(0,113,227,.08); }
.kit-icon { font-size: 22px; }
.kit-name { font-weight: 700; color: var(--text); font-size: 14px; }
.kit-desc { color: var(--text-2); font-size: 12px; line-height: 1.45; }
.kit-proposal { margin-top: 4px; }
.kit-diff-head { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .4px; margin: 12px 0 4px; }
.kit-proposal .edit-row { margin-bottom: 8px; }
.kit-proposal .edit-row label { display: block; color: var(--text-2); font-size: 12px; margin-bottom: 4px; }
.kit-proposal .form-input { width: 100%; }

/* ---------- projects feed ---------- */
.projects-wrap { max-width: 1100px; margin: 0 auto; padding: 12px 20px 50px; }
.proj-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.proj-search-input { flex: 1; max-width: 300px; margin: 0; }
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.proj-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; text-decoration: none; display: block; transition: box-shadow .18s ease, transform .18s ease; }
.proj-card:hover { box-shadow: 0 12px 28px rgba(0,0,0,.1); transform: translateY(-2px); }
.proj-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.proj-name { color: var(--text); font-size: 17px; font-weight: 700; }
.proj-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.proj-tag { background: var(--card-3); color: var(--text-2); font-size: 11px; padding: 2px 9px; border-radius: 999px; }
.proj-desc { color: #4d4d52; font-size: 13px; line-height: 1.6; margin: 8px 0 12px; }
.proj-bar { height: 6px; background: var(--bar); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.proj-fill { height: 100%; background: #0071e3; }
.proj-meta { display: flex; gap: 14px; color: var(--text-2); font-size: 12px; flex-wrap: wrap; }
.proj-creator { margin-left: auto; color: var(--text); font-weight: 600; }
@media (max-width: 860px) { .proj-grid { grid-template-columns: 1fr; } }

/* ---------- project detail ---------- */
.project-wrap { max-width: 1200px; margin: 0 auto; padding: 26px 20px 50px; }
.proj-head { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.proj-head-main { flex: 1; min-width: 260px; }
.proj-title { color: var(--text); font-size: 26px; font-weight: 700; margin: 0; }
.proj-desc-full { color: #4d4d52; font-size: 14px; line-height: 1.65; margin: 8px 0 10px; max-width: 640px; }
.proj-members-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.proj-members-row svg { width: 30px; height: 30px; border-radius: 50%; }
.proj-members-row span { color: var(--text-2); font-size: 12px; margin-left: 4px; }
.proj-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 18px; }
.kanban-col { background: var(--card-2); border-radius: 16px; padding: 12px; min-height: 220px; align-self: start; }
.kanban-col h3 { margin: 2px 6px 10px; font-size: 13px; letter-spacing: .5px; text-transform: uppercase; color: var(--text-2); display: flex; justify-content: space-between; }
.kanban-col h3 b { color: var(--text-3); }
.task-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.task-title { color: var(--text); font-size: 13px; line-height: 1.45; margin-bottom: 8px; }
.task-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.task-assign { font-size: 12px; color: var(--text-2); border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 3px 6px; font-family: inherit; cursor: pointer; max-width: 130px; }
.task-move { font-size: 11px; color: var(--text-2); background: none; border: none; cursor: pointer; padding: 2px 4px; font-family: inherit; }
.task-move:hover { color: var(--accent); }
.task-del { margin-left: auto; font-size: 11px; color: var(--text-3); background: none; border: none; cursor: pointer; font-family: inherit; }
.task-del:hover { color: var(--negative); }
.task-add { display: flex; gap: 6px; margin-top: 4px; }
.task-add input { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; font-size: 13px; color: var(--text); font-family: inherit; outline: none; }
.task-add input:focus { border-color: var(--accent); }

/* ---------- project layout with chat ---------- */
.project-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 14px; margin-top: 18px; align-items: start; }
@media (max-width: 1000px) { .project-grid { grid-template-columns: 1fr; } .kanban { grid-template-columns: 1fr; } }

.pchat { background: #fff; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; height: 480px; position: sticky; top: 80px; }
.pchat-head { padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,.06); font-weight: 700; color: var(--text); font-size: 14px; }
.pchat-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pchat-msg { max-width: 85%; }
.pchat-msg .who { font-size: 11px; color: var(--text-2); margin-bottom: 2px; }
.pchat-msg .bubble { display: inline-block; padding: 7px 12px; border-radius: 14px; font-size: 13px; line-height: 1.5; background: var(--card-2); color: var(--text); word-wrap: break-word; }
.pchat-msg.me { align-self: flex-end; text-align: right; }
.pchat-msg.me .bubble { background: #0071e3; color: #fff; }
.pchat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(0,0,0,.06); }
.pchat-input input { flex: 1; background: var(--search); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--text); font-family: inherit; outline: none; }
.pchat-input button { border-radius: 999px; padding: 8px 14px; }

/* ---------- chat page ---------- */
.chat-wrap { max-width: 1050px; margin: 0 auto; padding: 26px 20px 40px; }
.chat-layout { display: grid; grid-template-columns: 300px 1fr; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; height: 620px; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--card-2); }
.chat-list h2 { font-size: 16px; margin: 14px 16px 10px; color: var(--text); }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: inherit; }
.chat-item:hover { background: var(--card-3); }
.chat-item.active { background: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.chat-item svg { width: 40px; height: 40px; flex: 0 0 auto; }
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-name { color: var(--text); font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.chat-item-last { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-unread { background: #ff3b30; color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; }
.chat-pane-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-pane-head svg { width: 38px; height: 38px; }
.chat-pane-head .name { color: var(--text); font-weight: 700; font-size: 15px; }
.chat-pane-head .sub { color: var(--text-2); font-size: 12px; margin-top: 1px; }
.chat-pane-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 70%; }
.chat-msg .bubble { display: inline-block; padding: 8px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; background: var(--card-3); color: var(--text); word-wrap: break-word; }
.chat-msg .time { font-size: 10px; color: var(--text-3); margin-top: 3px; }
.chat-msg.me { align-self: flex-end; text-align: right; }
.chat-msg.me .bubble { background: #0071e3; color: #fff; }
.chat-typing { font-size: 12px; color: var(--text-2); font-style: italic; padding: 4px 14px; }
.chat-input-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.chat-input-row input { flex: 1; background: var(--search); border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; font-size: 14px; color: var(--text); font-family: inherit; outline: none; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 14px; }
@media (max-width: 800px) { .chat-layout { grid-template-columns: 1fr; height: auto; } .chat-list { max-height: 260px; border-right: none; border-bottom: 1px solid var(--line); } }

/* ---------- meetings ---------- */
.meet-wrap { max-width: 1100px; margin: 0 auto; padding: 26px 20px 40px; }
.lobby-panel { max-width: 480px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: 0 10px 40px rgba(0,0,0,.1); }
.lobby-panel h1 { margin: 0 0 4px; font-size: 24px; color: var(--text); }
.lobby-panel .sub { color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.lobby-code { display: flex; align-items: center; gap: 10px; background: var(--card-2); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; }
.lobby-code b { font-size: 22px; letter-spacing: 4px; color: var(--text); }
.lobby-video { width: 100%; border-radius: 12px; background: #1d1d1f; margin-bottom: 14px; min-height: 220px; object-fit: cover; }
.lobby-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.meet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.meet-tile { position: relative; background: #1d1d1f; border-radius: 14px; overflow: hidden; aspect-ratio: 16/10; }
.meet-tile video { width: 100%; height: 100%; object-fit: cover; }
.meet-tile .tag { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.meet-bar { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.meet-bar .spacer { flex: 1; }
.meet-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.meet-head h1 { font-size: 24px; color: var(--text); margin: 0; flex: 1; min-width: 200px; }
.meet-participants { display: flex; align-items: center; gap: 6px; }
.meet-participants svg { width: 28px; height: 28px; }

/* ---------- responsive: phones ---------- */
@media (max-width: 720px) {
  .proj-toolbar { gap: 8px; margin-bottom: 14px; }
  .proj-toolbar .form-input { font-size: 16px; }

  .kanban { gap: 10px; margin-top: 14px; }
  .kanban-col { padding: 10px; }
  .kanban-col h3 { font-size: 12px; margin: 0 2px 8px; }
  .task-card { padding: 10px; }
  .task-add .form-input { font-size: 16px; }

  .proj-head { padding: 16px; gap: 14px; }
  .proj-head-main { min-width: 0; }
  .proj-actions { width: 100%; gap: 6px; }
  .proj-actions .btn-green,
  .proj-actions .btn-dark { flex: 1 1 auto; }

  /* the project chat is sticky with a fixed height; on a phone it becomes a
     normal block so it does not cover the kanban */
  .pchat { height: 340px; position: static; top: auto; }
  .pchat-input .form-input { font-size: 16px; }

  .chat-layout { height: auto; }
  .chat-list { max-height: 220px; }
  .chat-pane { min-height: 340px; }
  .pchat-pane-input .form-input, .chat-pane .form-input { font-size: 16px; }

  .meet-wrap { padding: 18px 14px 40px; }
  .lobby-panel { padding: 22px 18px; border-radius: 0; }
  .lobby-panel h1 { font-size: 21px; }
  .meet-head h1 { font-size: 20px; min-width: 0; }
  .meet-participants { flex-wrap: wrap; }
  .pchat video, .meet-wrap video { width: 100%; height: auto; }
}

@media (max-width: 420px) {
  .kanban-col { padding: 8px; }
  .proj-actions .btn-green,
  .proj-actions .btn-dark { flex: 1 1 100%; }
}

@media (max-width: 720px) {
  /* a flex input needs min-width:0 or the placeholder is clipped by its flex-basis */
  .task-add { gap: 5px; }
  .task-add input { min-width: 0; font-size: 16px; padding: 8px 10px; }
  .task-add button, .task-add .btn-green { flex: 0 0 auto; }
  .pchat-input input, .chat-input input { min-width: 0; }
}
