* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; background: #f4f6f8; color: #222; padding: 12px; padding-bottom: 80px; line-height: 1.4; }
.container { max-width: 1100px; margin: 0 auto; }
h1 { font-size: 20px; color: #1a4d8f; margin-bottom: 4px; }
.sub { color: #666; font-size: 12px; margin-bottom: 12px; }
.card { background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
h2 { color: #1a4d8f; font-size: 15px; margin-bottom: 10px; border-bottom: 1px solid #eef; padding-bottom: 6px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.row > * { flex: 1; min-width: 100px; }
input, select, textarea { padding: 8px 10px; border: 1px solid #ccd; border-radius: 6px; font-size: 14px; font-family: inherit; width: 100%; background: #fff; }
input:focus, select:focus { outline: 2px solid #4a90e2; }
button { padding: 9px 14px; border: none; border-radius: 6px; background: #1a4d8f; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
button:hover { opacity: 0.9; }
button.danger { background: #c0392b; }
button.success { background: #27ae60; }
button.ghost { background: #eef; color: #1a4d8f; }
button.small { padding: 5px 9px; font-size: 12px; }

#login-screen { display: none; text-align: center; padding: 60px 20px; }
#login-screen h1 { font-size: 28px; margin-bottom: 10px; }
#login-screen p { color: #666; margin-bottom: 24px; }
.g-signin-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; background: #fff; color: #333; border: 1px solid #dadce0; border-radius: 8px; font-weight: 600; text-decoration: none; font-size: 15px; transition: 0.2s; }
.g-signin-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.user-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 8px 12px; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-info img { width: 32px; height: 32px; border-radius: 50%; }
.user-info span { font-size: 13px; color: #333; font-weight: 600; }
.sync-status { font-size: 11px; color: #999; }
.sync-status.ok { color: #27ae60; }
.sync-status.sync { color: #f39c12; }
.sync-status.err { color: #c0392b; }

.pomodoro { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px; text-align: center; position: relative; }
.pomodoro .streak { position: absolute; top: 10px; right: 14px; background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pomodoro .time { font-size: 42px; font-weight: 700; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.pomodoro .mode { font-size: 12px; opacity: 0.9; margin-bottom: 6px; letter-spacing: 1px; text-transform: uppercase; }
.pomodoro .quote { font-size: 13px; font-style: italic; opacity: 0.95; margin: 8px auto; max-width: 600px; padding: 0 10px; min-height: 36px; }
.pomodoro .quote-author { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.pomodoro .btns { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.pomodoro button { background: rgba(255,255,255,0.2); }
.pomodoro button.primary { background: #fff; color: #764ba2; }
.pomodoro .cycle { font-size: 12px; opacity: 0.9; margin-top: 6px; }
.pomodoro .settings { font-size: 12px; margin-top: 8px; }
.pomodoro .settings input { width: 55px; padding: 4px 6px; font-size: 12px; color: #333; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; background: #fff; padding: 4px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.tab { flex: 1; padding: 8px 10px; background: transparent; color: #555; border: none; border-radius: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer; }
.tab.active { background: #1a4d8f; color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid #eef; }
th { background: #f0f4f8; color: #1a4d8f; font-size: 12px; font-weight: 600; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge.R { background: #e3f0ff; color: #1a4d8f; }
.badge.O { background: #fff3e0; color: #b26a00; }
.badge.p1 { background: #ffe5e5; color: #c0392b; }
.badge.p2 { background: #fff3e0; color: #b26a00; }
.badge.p3 { background: #e8f5e9; color: #2e7d32; }
.badge.done { background: #e8f5e9; color: #2e7d32; }
.badge.partial { background: #fff9c4; color: #827717; }
.badge.missed { background: #ffebee; color: #c62828; }
.badge.pending { background: #eceff1; color: #546e7a; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.metric { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; padding: 12px; border-radius: 8px; text-align: center; }
.metric.green { background: linear-gradient(135deg, #11998e, #38ef7d); }
.metric.pink { background: linear-gradient(135deg, #f093fb, #f5576c); }
.metric.blue { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.metric .val { font-size: 22px; font-weight: 700; }
.metric .lbl { font-size: 11px; opacity: 0.9; margin-top: 2px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-head { font-size: 11px; text-align: center; color: #666; padding: 4px 0; font-weight: 600; }
.cal-day { aspect-ratio: 1; background: #f9fafb; border-radius: 6px; padding: 4px; font-size: 12px; cursor: pointer; position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.cal-day:hover { background: #eef; }
.cal-day.today { background: #1a4d8f; color: #fff; font-weight: 700; }
.cal-day.other { opacity: 0.35; }
.cal-day .num { font-weight: 600; }
.cal-day .dots { display: flex; gap: 2px; margin-top: 2px; }
.cal-day .dot { width: 5px; height: 5px; border-radius: 50%; background: #27ae60; }
.cal-day .dot.missed { background: #c0392b; }
.cal-day .dot.partial { background: #f39c12; }

.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.bar-label { width: 70px; color: #555; }
.bar-track { flex: 1; height: 16px; background: #eef; border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #1a4d8f, #4a90e2); transition: width 0.4s; }
.bar-fill.green { background: linear-gradient(90deg, #27ae60, #38ef7d); }
.bar-value { width: 60px; text-align: right; color: #333; font-weight: 600; }

.empty { text-align: center; color: #999; padding: 24px; font-style: italic; font-size: 13px; }
.footer-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

#toast-container { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border-radius: 8px; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideDown 0.3s; }
.toast.info { background: #1a4d8f; }
.toast.warn { background: #f39c12; }
.toast.err { background: #c0392b; }
.toast.ok { background: #27ae60; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

#overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.94); color: #fff; z-index: 99999; justify-content: center; align-items: center; flex-direction: column; padding: 20px; text-align: center; }
#overlay.show { display: flex; }
#overlay .ov-title { font-size: 48px; font-weight: 700; margin-bottom: 20px; }
#overlay .ov-timer { font-size: 72px; font-variant-numeric: tabular-nums; margin-bottom: 30px; }
#overlay .ov-quote { font-size: 20px; font-style: italic; max-width: 700px; opacity: 0.9; line-height: 1.6; }
#overlay .ov-author { font-size: 14px; opacity: 0.7; margin-top: 16px; }
#overlay button { margin-top: 30px; background: rgba(255,255,255,0.15); }