* { box-sizing: border-box; margin: 0; padding: 0; overscroll-behavior-y: contain; }

.pull-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0.75rem;
  font-size: 0.9rem;
  color: white;
  font-weight: 600;
  background: #6c5ce7;
  transform: translateY(-50px);
  opacity: 0;
  transition: transform 0.2s, opacity 0.2s;
  z-index: 100;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  padding: 1rem;
}

.container {
  max-width: 480px;
  margin: 0 auto;
}

h1 {
  font-size: 1.4rem;
  color: #6c5ce7;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1.5rem;
}

.card {
  background: #16213e;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
}

.status-dot.active { background: #00b894; }
.status-dot.error { background: #ff6b6b; }

.status-text {
  font-size: 0.9rem;
}

button {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:active { opacity: 0.8; }

button.primary {
  background: #6c5ce7;
  color: white;
}

button.danger {
  background: #ff6b6b;
  color: white;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ios-instructions {
  background: #1e2a4a;
  border: 1px solid #6c5ce7;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.ios-instructions strong {
  color: #6c5ce7;
}

h2 {
  font-size: 1.1rem;
  color: #ccc;
  margin-bottom: 0.75rem;
}

.notification-list {
  list-style: none;
}

.notification-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #2a2a4a;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(108, 92, 231, 0.2);
  transition: background 0.15s;
}

.notification-item:active {
  background: rgba(108, 92, 231, 0.1);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #6c5ce7;
}

.notification-body {
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.2rem;
}

.notification-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #00b894;
  margin-top: 0.25rem;
}

.empty {
  color: #666;
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem 0;
}

#test-btn {
  margin-top: 0.75rem;
  padding: 0.5rem;
  font-size: 0.85rem;
  background: #2a2a4a;
  color: #aaa;
}

.action-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.action-row button {
  width: auto;
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
}

.btn-approve {
  background: #00b894;
  color: white;
}

.btn-reject {
  background: #636e72;
  color: white;
}

.responded {
  font-size: 0.8rem;
  color: #00b894;
  font-weight: 600;
  text-transform: capitalize;
}

.respond-error {
  font-size: 0.8rem;
  color: #ff6b6b;
}

.text-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.text-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 0.85rem;
  outline: none;
}

.text-input:focus {
  border-color: #6c5ce7;
}

.btn-send {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  background: #6c5ce7;
  color: white;
}

/* Session management */

.dir-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dir-btn {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  background: #6c5ce7;
  color: white;
}

.session-heading {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #2a2a4a;
}

.session-item:last-child {
  border-bottom: none;
}

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

.session-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #00b894;
}

.session-path {
  font-size: 0.75rem;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-kill {
  width: auto;
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  background: #ff6b6b;
  color: white;
  margin-left: 0.5rem;
}

/* Choice buttons for permission notifications */

.btn-choice {
  width: auto;
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  color: white;
}

.btn-choice-1 { background: #00b894; }
.btn-choice-2 { background: #6c5ce7; }
.btn-choice-3 { background: #636e72; }

.choice-grid {
  flex-direction: column;
}
.choice-grid .btn-choice {
  flex: none;
  text-align: left;
  background: #6c5ce7;
}
.choice-grid .btn-choice:last-child {
  background: #636e72;
}

/* Tool detail lines in notification messages */

.tool-detail {
  font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: #888;
}

/* Notification detail modal */

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.open .modal-backdrop {
  opacity: 1;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: #16213e;
  border-radius: 16px 16px 0 0;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: #2a2a4a;
  color: #aaa;
  font-size: 1.2rem;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
}

.modal-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: #6c5ce7;
  padding-right: 2rem;
  margin-bottom: 0.75rem;
}

.modal-body {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.modal-time {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 1rem;
}

.modal-context {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2a2a4a;
  font-size: 0.8rem;
  color: #888;
  line-height: 1.4;
}

.modal-actions {
  margin-top: 0.5rem;
}
