/* AUTH */
.auth-screen{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:20px;background:var(--bg2)}
.auth-box{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:32px;width:100%;max-width:360px;text-align:center}
.auth-box h1{font-size:1.2rem;margin-bottom:4px;font-weight:700}
.auth-box .sub{color:var(--text3);font-size:12px;margin-bottom:24px}
.auth-box input{width:100%;background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:11px 14px;color:var(--text);font-size:13px;outline:none;margin-bottom:10px;font-family:inherit}
.auth-box input:focus{border-color:var(--accent)}
.auth-box button{width:100%;background:var(--accent);color:white;border:none;border-radius:var(--radius-sm);padding:11px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.auth-msg{font-size:11px;margin-top:10px;min-height:18px}
.auth-msg.error{color:var(--red)}

/* APP LAYOUT */
.app{display:none;flex-direction:column;height:100vh;height:100dvh}

/* HEADER */
.header{background:var(--surface);border-bottom:1px solid var(--border);padding:12px 16px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;position:sticky;top:0;z-index:10}
.header-left{display:flex;align-items:center;gap:8px}
.header-logo{width:24px;height:24px;background:var(--accent);border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:0.7rem}
.header-title{font-size:14px;font-weight:600}
.header-right{display:flex;align-items:center;gap:10px}
.header-date{font-size:11px;color:var(--text4);font-family:'JetBrains Mono',monospace}
.header-avatar{width:28px;height:28px;border-radius:50%;background:var(--accent-bg);border:1px solid var(--accent-border);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;color:var(--accent)}
.theme-toggle{background:none;border:1px solid var(--border);border-radius:var(--radius-sm);padding:4px 8px;cursor:pointer;font-size:12px;color:var(--text3)}

/* MAIN */
.main-content{flex:1;overflow-y:auto;padding-bottom:56px}

/* CHIPS */
.chips{display:flex;gap:6px;padding:8px 16px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;border-bottom:1px solid var(--border);background:var(--surface)}
.chips::-webkit-scrollbar{display:none}
.chip{display:flex;align-items:center;gap:5px;background:var(--bg2);border:1px solid var(--border);border-radius:20px;padding:5px 10px;flex-shrink:0;font-size:11px;font-weight:500;color:var(--text3);white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent}
.chip .dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}
.chip.active{color:var(--text);border-color:var(--accent-border);background:var(--accent-bg)}

/* SECTIONS */
.section{padding:12px 16px 4px}
.section-label{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:1.2px;color:var(--text4);margin-bottom:8px;display:flex;align-items:center;gap:6px}
.section-label .count{font-family:'JetBrains Mono',monospace;font-size:10px;color:var(--text3);background:var(--surface2);padding:1px 5px;border-radius:3px}
.section-label .icon{width:16px;height:16px;border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0}

/* FOCUS CARD */
.focus{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin:12px 16px 0;padding:14px;border-left:3px solid var(--accent)}
.focus-title{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:1px;color:var(--accent);margin-bottom:10px}
.focus-item{display:flex;align-items:flex-start;gap:10px;padding:6px 0}
.focus-item+.focus-item{border-top:1px solid var(--border)}
.focus-num{min-width:18px;height:18px;border-radius:50%;background:var(--accent-bg);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;margin-top:1px;flex-shrink:0}
.focus-text{font-size:13px;font-weight:500}
.focus-meta{font-size:11px;color:var(--text3);margin-top:1px}

/* ITEMS */
.item-list{padding:0 16px}
.item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);margin-bottom:4px;display:flex;align-items:stretch;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:border-color 0.15s,opacity 0.15s,transform 0.15s}
.item:active{border-color:var(--accent-border)}
.item.dragging{opacity:0.5;transform:scale(0.98)}
.item.drag-over{border-color:var(--accent);border-top:2px solid var(--accent)}
.drag-grip{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0 6px;cursor:grab;color:var(--text4);flex-shrink:0;gap:1px;touch-action:none}
.drag-grip span{display:block;width:10px;height:1.5px;background:var(--border2);border-radius:1px}
.item-color{width:3px;flex-shrink:0}
.item-color.red{background:var(--red)}.item-color.amber{background:var(--amber)}.item-color.blue{background:var(--blue)}.item-color.green{background:var(--green)}.item-color.accent{background:var(--accent)}
.item-body{flex:1;padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.item-left{min-width:0;flex:1}
.item-title{font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item-title.done{text-decoration:line-through;color:var(--text3)}
.item-meta{font-size:11px;color:var(--text3);margin-top:1px;font-family:'JetBrains Mono',monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item-right{flex-shrink:0;display:flex;align-items:center;gap:6px}
.check{width:16px;height:16px;border-radius:50%;border:1.5px solid var(--border2);flex-shrink:0;cursor:pointer;transition:all 0.15s;display:flex;align-items:center;justify-content:center}
.check:hover{border-color:var(--accent)}
.check.done{background:var(--green);border-color:var(--green)}
.check.done::after{content:'✓';color:white;font-size:9px;font-weight:800}

/* BADGES */
.badge{font-size:9px;font-weight:600;padding:2px 6px;border-radius:3px;letter-spacing:0.3px;white-space:nowrap}
.badge-red{background:var(--red-bg);color:var(--red)}
.badge-amber{background:var(--amber-bg);color:var(--amber)}
.badge-blue{background:var(--blue-bg);color:var(--blue)}
.badge-green{background:var(--green-bg);color:var(--green)}
.badge-accent{background:var(--accent-bg);color:var(--accent)}

/* METRICS */
.metrics{display:flex;gap:8px;padding:0 16px 4px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.metrics::-webkit-scrollbar{display:none}
.metric{min-width:100px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 12px;flex-shrink:0}
.metric-label{font-size:9px;font-weight:600;text-transform:uppercase;letter-spacing:0.8px;color:var(--text4)}
.metric-value{font-size:20px;font-weight:700;font-family:'JetBrains Mono',monospace;margin-top:2px}
.metric-value.good{color:var(--green)}.metric-value.bad{color:var(--red)}.metric-value.neutral{color:var(--text3)}
.metric-sub{font-size:10px;color:var(--text4);margin-top:1px}

/* THREAD LIST */
.thread-list{padding:0 16px;display:flex;flex-direction:column;gap:4px}
.thread-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px 14px;cursor:pointer;display:flex;align-items:center;gap:12px;transition:border-color 0.15s;-webkit-tap-highlight-color:transparent}
.thread-card:active{border-color:var(--accent-border)}
.thread-icon{width:28px;height:28px;border-radius:6px;background:var(--surface2);display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0}
.thread-info{flex:1;min-width:0}
.thread-name{font-size:13px;font-weight:500}
.thread-preview{font-size:11px;color:var(--text3);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thread-badge{min-width:18px;height:18px;border-radius:9px;background:var(--accent);color:white;font-size:9px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}

/* THREAD DETAIL */
.thread-view{display:none;flex-direction:column;height:100%;position:fixed;inset:0;background:var(--bg2);z-index:100}
.thread-header{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--surface);flex-shrink:0}
.thread-back{font-size:18px;cursor:pointer;padding:4px;color:var(--text3);-webkit-tap-highlight-color:transparent}
.thread-header-icon{font-size:16px}
.thread-header-title{font-size:14px;font-weight:600}

/* STATUS CARD (top of each thread) */
.status-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin:12px 16px;padding:14px}
.status-section{margin-bottom:10px}
.status-section:last-child{margin-bottom:0}
.status-label{font-size:9px;font-weight:600;text-transform:uppercase;letter-spacing:1px;color:var(--text4);margin-bottom:4px}
.status-text{font-size:12px;color:var(--text2);line-height:1.5}
.status-items{list-style:none}
.status-items li{font-size:12px;color:var(--text2);padding:2px 0;display:flex;align-items:flex-start;gap:6px}
.status-items li::before{content:'→';color:var(--accent);font-weight:600;flex-shrink:0}

.thread-messages{flex:1;overflow-y:auto;padding:0 16px 16px}
.msg{margin-bottom:12px;max-width:88%}
.msg.huck{margin-right:auto}
.msg.kevin{margin-left:auto}
.msg-name{font-size:9px;font-weight:600;text-transform:uppercase;letter-spacing:0.8px;color:var(--text4);margin-bottom:3px;padding:0 2px}
.msg.kevin .msg-name{text-align:right}
.msg-bubble{padding:10px 14px;border-radius:14px;font-size:13px;line-height:1.6}
.msg.huck .msg-bubble{background:var(--surface);border:1px solid var(--border);border-bottom-left-radius:4px}
.msg.kevin .msg-bubble{background:var(--accent-bg);border:1px solid var(--accent-border);border-bottom-right-radius:4px}
.msg-time{font-size:9px;color:var(--text4);margin-top:3px;padding:0 4px;font-family:'JetBrains Mono',monospace}
.msg.kevin .msg-time{text-align:right}

.thread-input-bar{display:flex;gap:8px;padding:10px 16px 24px;border-top:1px solid var(--border);background:var(--surface);flex-shrink:0}
.thread-input{flex:1;background:var(--surface2);border:1px solid var(--border);border-radius:20px;padding:10px 16px;color:var(--text);font-size:13px;outline:none;font-family:inherit;resize:none;max-height:100px}
.thread-input:focus{border-color:var(--accent-border)}
.thread-send{background:var(--accent);color:white;border:none;border-radius:50%;width:36px;height:36px;font-size:14px;cursor:pointer;flex-shrink:0;display:flex;align-items:center;justify-content:center}

/* PING CARD */
.ping-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px;margin:0 16px 8px}
.ping-header{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.ping-label{font-size:9px;font-weight:600;text-transform:uppercase;letter-spacing:1px;color:var(--amber)}
.ping-date{font-size:9px;color:var(--text4);margin-left:auto;font-family:'JetBrains Mono',monospace}
.ping-content{font-size:12px;line-height:1.6;color:var(--text2)}

/* CHAT TAB */
.chat-container{display:flex;flex-direction:column;height:calc(100vh - 108px);height:calc(100dvh - 108px)}
.chat-messages{flex:1;overflow-y:auto;padding:16px}
.chat-input-bar{display:flex;gap:8px;padding:10px 16px 24px;border-top:1px solid var(--border);background:var(--surface);flex-shrink:0}
.chat-input{flex:1;background:var(--surface2);border:1px solid var(--border);border-radius:20px;padding:10px 16px;color:var(--text);font-size:13px;outline:none;font-family:inherit;resize:none;max-height:100px}
.chat-input:focus{border-color:var(--accent-border)}

/* BOTTOM NAV */
.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:var(--surface);border-top:1px solid var(--border);display:flex;height:52px;z-index:50}
.btab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:9px;font-weight:600;color:var(--text4);letter-spacing:0.3px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.btab.active{color:var(--accent)}
.btab-icon{width:20px;height:20px;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:12px}
.btab.active .btab-icon{background:var(--accent-bg)}

.hidden{display:none!important}
.empty-state{text-align:center;padding:40px 20px;color:var(--text3);font-size:13px}

@media(min-width:768px){
  .bottom-nav{max-width:480px;left:50%;transform:translateX(-50%)}
  body{max-width:480px;margin:0 auto}
}
/* TASK MODAL */
.task-modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.6);z-index:200;align-items:flex-end;justify-content:center}
.task-modal-overlay.open{display:flex}
.task-modal{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius) var(--radius) 0 0;width:100%;max-width:480px;max-height:85vh;overflow-y:auto;padding:20px;animation:slideUp 0.2s ease-out}
@keyframes slideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
.task-modal h3{font-size:15px;font-weight:700;margin-bottom:16px;display:flex;align-items:center;justify-content:space-between}
.task-modal .close-btn{background:none;border:none;color:var(--text3);cursor:pointer;font-size:18px;padding:4px}
.task-modal .field{margin-bottom:14px}
.task-modal .field-label{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:1px;color:var(--text4);margin-bottom:4px;display:block}
.task-modal input,.task-modal textarea,.task-modal select{width:100%;background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 12px;color:var(--text);font-size:13px;outline:none;font-family:inherit}
.task-modal input:focus,.task-modal textarea:focus{border-color:var(--accent)}
.task-modal textarea{resize:vertical;min-height:60px}
.task-modal .btn-row{display:flex;gap:8px;margin-top:16px}
.task-modal .btn-save{flex:1;background:var(--accent);color:white;border:none;border-radius:var(--radius-sm);padding:10px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.task-modal .btn-delete{background:var(--red-bg);color:var(--red);border:1px solid rgba(220,38,38,0.2);border-radius:var(--radius-sm);padding:10px 16px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.task-modal .priority-pills{display:flex;gap:6px}
.task-modal .priority-pill{flex:1;padding:8px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface2);color:var(--text3);font-size:11px;font-weight:600;cursor:pointer;text-align:center;font-family:inherit}
.task-modal .priority-pill.active{border-color:var(--accent-border);background:var(--accent-bg);color:var(--accent)}
