* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--c-bg); color: var(--c-text); height: 100vh; overflow: hidden; }

.terminal-bar {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  height: 36px;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 200;
}
.terminal-bar-left { display: flex; align-items: center; gap: 10px; }
.terminal-bar-right { display: flex; align-items: center; gap: 8px; }
.terminal-session-name {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--c-text);
  letter-spacing: 0.02em;
}
.mode-badge {
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.mode-readonly {
  border: 1px solid rgba(74,222,128,0.25);
  background: rgba(74,222,128,0.08);
  color: var(--c-success);
}
.mode-writable {
  border: 1px solid rgba(251,191,36,0.2);
  background: rgba(251,191,36,0.06);
  color: var(--c-warning);
}
.btn-t {
  background: transparent;
  border: 1px solid var(--c-border-hover);
  color: var(--c-text-secondary);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-family: inherit;
  font-weight:400;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-t:hover { border-color: var(--c-text-secondary); color: var(--c-text); }
.back-link {
  font-size: 0.7rem;
  color: var(--c-text-secondary);
  text-decoration: none;
  font-weight:400;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.back-link:hover { color: var(--c-text-secondary); }

.terminal-frame {
  position: fixed;
  top: 36px;
  left: 0; right: 0;
  bottom: 0;
}
.terminal-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Session picker (no ?session= param) */
 .picker {
 position: fixed;
 top: calc(56px + 40px);
  left: 0; right: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 32px 24px 80px;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
  animation-delay: 0.2s;
}
.picker-inner { max-width: 640px; margin: 0 auto; }
.picker h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.picker p {
  font-size: 0.85rem;
  color: var(--c-text-secondary);
  font-weight: 400;
  margin-bottom: 24px;
}
.picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.picker-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.picker-card:hover { border-color: var(--c-border-hover); transform: translateY(-1px); }
.picker-card-name {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--c-text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.picker-card-oc-title { font-size: 0.75rem; font-weight: 400; color: var(--c-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.picker-card-detail { font-size: 0.7rem; color: var(--c-text-secondary); font-weight: 400; display: flex; align-items: center; gap: 8px; }
.oc-status-input-needed { background: rgba(167,139,250,0.1); color: #a78bfa; border: 1px solid rgba(167,139,250,0.2); animation: pulseBadgePurple 2.5s infinite; }
@keyframes pulseBadgePurple { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.todo-progress { font-size: 0.65rem; font-weight: 400; color: var(--c-text-secondary); }
.todo-progress-complete { color: var(--c-success); }
.type-badge {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.type-opencode { background: #1a2a1a; color: var(--c-success); border: 1px solid #2a3a2a; }
.type-shell { background: var(--c-border); color: var(--c-text-secondary); border: 1px solid #2a2a2a; }
.type-python { background: #1a1a2a; color: #818cf8; border: 1px solid #2a2a3a; }
.type-node { background: #2a2a1a; color: var(--c-warning); border: 1px solid #3a3a2a; }
.oc-status-badge { font-size: 0.6rem; font-weight: 400; letter-spacing: 0.05em; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; }
.oc-status-waiting { background: rgba(251,191,36,0.1); color: var(--c-warning); border: 1px solid rgba(251,191,36,0.2); }
.oc-status-working { background: rgba(74,222,128,0.08); color: var(--c-success); border: 1px solid rgba(74,222,128,0.15); animation: pulseBadge 2s infinite; }
.oc-status-error { background: rgba(248,113,113,0.08); color: var(--c-error); border: 1px solid rgba(248,113,113,0.15); animation: pulseBadge 2s infinite; }
@keyframes pulseBadge { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.new-session-section { margin-top: 16px; }
.new-session-section h3 {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--c-text-secondary);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.new-session-form { display: flex; gap: 10px; }
.new-session-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  color: var(--c-text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.new-session-input:focus { outline: none; border-color: var(--c-text-secondary); }
.new-session-input::placeholder { color: #777; }
.btn-new {
  background: transparent;
  border: 1px solid var(--c-border-hover);
  color: var(--c-text-secondary);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight:400;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-new:hover { border-color: var(--c-text-secondary); color: var(--c-text); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .picker-grid { grid-template-columns: 1fr; }
}
