:root {
  --bg: #f4f6f8;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2f6f4f;
  --primary-dark: #244f38;
  --accent: #d97706;
  --danger: #b91c1c;
  --border: #e5e7eb;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 24px 20px 18px;
  border-radius: 0 0 20px 20px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.app-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.today-date {
  font-size: 0.85rem;
  opacity: 0.9;
  text-transform: capitalize;
}

.week-badge {
  margin-top: 10px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.install-banner {
  margin: 12px 16px 0;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
  color: #78350f;
}

.install-banner-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}

main {
  padding: 16px;
  flex: 1;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.quote-card {
  background: linear-gradient(135deg, #fef3e2, #fde8c8);
  border: none;
}

.quote-text {
  font-size: 1.05rem;
  font-style: italic;
  margin: 0 0 6px;
  line-height: 1.5;
}

.quote-source {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

.smoke-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.smoke-header h2 { margin: 0; }

.streak-badge {
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.smoke-message {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 8px 0 14px;
}

.smoke-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.task-list li:last-child { border-bottom: none; }

.task-list input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.task-list label {
  font-size: 0.95rem;
  cursor: pointer;
}

.task-list li.done label {
  text-decoration: line-through;
  color: var(--muted);
}

.empty-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.saved-msg {
  color: var(--primary);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.danger-card {
  border-color: #fca5a5;
}

.week-overview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 16px;
}

.day-card.is-today {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(47, 111, 79, 0.15);
}

.day-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.day-name {
  font-weight: 700;
  text-transform: capitalize;
}

.day-type {
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}

.day-type.com {
  background: #dcfce7;
  color: #166534;
}

.day-type.sem {
  background: #e0e7ff;
  color: #3730a3;
}

.day-tasks {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

.day-tasks li { margin-bottom: 2px; }

.schedule-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.schedule-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.schedule-list li:last-child { border-bottom: none; }

.schedule-time {
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.schedule-child {
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.manage-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.manage-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.manage-list li:last-child { border-bottom: none; }

.manage-list .remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px 6px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-form input,
.inline-form select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  flex: 1 1 120px;
  min-width: 0;
}

.inline-form .btn-small {
  flex: 1 1 100%;
}
