:root {
  --bg: #f3f4f6;
  --card: #fff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #1f6a49;
  --danger: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.app { max-width: 760px; margin: 0 auto; padding: 12px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.topbar h1 { margin: 0; font-size: 22px; }
#app-version { color: var(--muted); font-size: 12px; }
.screen.hidden { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.link-btn { border: none; background: transparent; color: var(--accent); padding: 0; margin-bottom: 10px; font-size: 16px; }
.assignment { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.assignment-title { font-weight: 700; margin-bottom: 6px; font-size: 16px; }
.meta { font-size: 13px; color: var(--muted); margin: 3px 0; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: 12px; border: 1px solid var(--line); margin-right: 6px; }
.priority-urgent { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.priority-important { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.priority-normal { background: #e0ecff; color: #1d4ed8; border-color: #bfdbfe; }
.priority-low { background: #f3f4f6; color: #374151; }
.action-box { margin-top: 10px; }
.btn { border: none; border-radius: 10px; padding: 10px 12px; font-size: 14px; background: #e5e7eb; color: var(--text); }
.btn.primary { background: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 8px 0 10px; font: inherit; }
.banner { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-size: 14px; }
.banner.offline { background: #fef3c7; color: #92400e; }
.banner.install { background: #dcfce7; color: #14532d; }
.hidden { display: none !important; }

.detail-carousel { position: relative; margin: 8px 0 12px; }
.detail-carousel-track { position: relative; overflow: hidden; border-radius: 10px; }
.detail-carousel-slide { display: none; width: 100%; height: 220px; object-fit: cover; background: #d1d5db; }
.detail-carousel-slide.active { display: block; }
.detail-carousel-prev, .detail-carousel-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: none; background: rgba(0,0,0,.45); color: #fff; width: 34px; height: 34px; border-radius: 999px;
}
.detail-carousel-prev { left: 8px; }
.detail-carousel-next { right: 8px; }
.detail-carousel-dots { text-align: center; margin-top: 8px; }
.detail-carousel-dot { display: inline-block; width: 7px; height: 7px; border-radius: 999px; background: #d1d5db; margin: 0 3px; }
.detail-carousel-dot.active { background: var(--accent); }

.photo-editor { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-editor-item { width: 76px; height: 76px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.photo-editor-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-editor-main { position: absolute; top: 3px; right: 4px; color: #f59e0b; }
.photo-editor-add { width: 76px; height: 76px; border: 1px dashed #9ca3af; border-radius: 8px; background: #fff; font-size: 11px; color: #4b5563; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.photo-fullscreen-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 1000; }
.photo-fullscreen-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.photo-fullscreen-wrap img { max-width: 94vw; max-height: 76vh; object-fit: contain; }
.photo-fullscreen-close, .photo-fullscreen-close-bottom { position: absolute; border: none; color: #fff; background: rgba(0,0,0,.45); border-radius: 8px; }
.photo-fullscreen-close { top: 14px; right: 14px; width: 36px; height: 36px; font-size: 20px; }
.photo-fullscreen-close-bottom { bottom: 14px; left: 50%; transform: translateX(-50%); padding: 8px 12px; }
.photo-fullscreen-controls { position: absolute; left: 0; right: 0; top: 50%; display: flex; justify-content: space-between; padding: 0 8px; }
.photo-fullscreen-nav { border: none; background: rgba(0,0,0,.5); color: #fff; width: 34px; height: 34px; border-radius: 999px; }
.photo-fullscreen-counter { position: absolute; left: 50%; transform: translateX(-50%); top: 44px; color: #fff; font-size: 12px; }
