
/* V8.14 Compact Mobile Timetable */
html { font-size: 14px; }
body { overflow-x: hidden; }
* { box-sizing: border-box; }
button, input, select, textarea { font-size: 13px; }
h1 { font-size: 20px; line-height: 1.2; }
h2 { font-size: 17px; line-height: 1.2; }
h3 { font-size: 15px; line-height: 1.2; }
p, label, .muted, .small { font-size: 12px; }
.app, main, .page, .content, .screen { max-width: 100%; width: 100%; overflow-x: hidden; }
table { width: 100%; table-layout: fixed; font-size: 11px; }
th, td { padding: 5px 4px; overflow-wrap: anywhere; word-break: break-word; }
.card, .panel, .modal-card { max-width: 100%; }
.modal-card { width: min(94vw, 520px); max-height: 88vh; overflow-y: auto; }
input, select, textarea { max-width: 100%; }
textarea { min-height: 70px; }
button { min-height: 36px; padding: 7px 10px; }
@media (max-width: 600px) {
  html { font-size: 13px; }
  h1 { font-size: 18px; }
  h2 { font-size: 16px; }
  h3 { font-size: 14px; }
  .timetable-list, .monthly-timetable, .timetable-month-list { width: 100%; }
  .timetable-entry, .timetable-day, .timetable-card {
    width: 100%;
    min-width: 0;
    padding: 8px;
    margin-bottom: 7px;
  }
  .timetable-entry *, .timetable-day *, .timetable-card * { min-width: 0; }
  .timetable-subject, .subject, .task-title { font-size: 12px; line-height: 1.3; }
  .timetable-date, .day-heading { font-size: 12px; font-weight: 700; }
  .progress-report, .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
  .bottom-nav { font-size: 11px; }
  .bottom-nav button, .bottom-nav a { padding: 6px 3px; min-width: 0; }
}


/* V8.15 phone-safe timetable modal */
.df-tt-overlay{position:fixed;inset:0;z-index:100000;background:rgba(0,0,0,.48);display:flex;align-items:center;justify-content:center;padding:10px;overflow:auto}
.df-tt-modal{width:min(92vw,390px);max-height:82vh;overflow:auto;background:var(--card,#fff);color:var(--text,#111);border-radius:16px;padding:12px;box-shadow:0 12px 40px rgba(0,0,0,.28);font-size:12px}
.df-tt-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:15px}
.df-tt-head button{border:0;background:transparent;font-size:20px;line-height:1;padding:2px 6px}
.df-tt-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.df-tt-modal label{display:block;font-size:11px;margin:5px 0}
.df-tt-modal input,.df-tt-modal textarea{display:block;width:100%;max-width:100%;min-height:32px;padding:6px 7px;font-size:12px;border-radius:8px}
.df-tt-modal details{margin-top:7px}
.df-tt-modal summary{font-size:11px;padding:5px 0}
.df-tt-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:9px}
.df-tt-actions button{font-size:12px;min-height:32px;padding:6px 10px}
@media(max-width:430px){.df-tt-overlay{padding:7px}.df-tt-modal{width:94vw;max-height:80vh;padding:10px}.df-tt-grid{gap:5px}}


/* V8.16 Excel-style timetable: compact side-by-side columns */
.df-excel-wrap{width:100%;max-width:100%;overflow-x:hidden;border:1px solid var(--border,#ddd);border-radius:8px;background:var(--card,#fff)}
.df-excel-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:10px;line-height:1.2}
.df-excel-table th,.df-excel-table td{border:1px solid var(--border,#ddd);padding:4px 3px;vertical-align:top;overflow-wrap:anywhere;word-break:break-word}
.df-excel-table th{font-size:9px;font-weight:700;white-space:nowrap;text-align:center}
.df-excel-table th:first-child{width:11%}.df-excel-table th:nth-child(2){width:27%}.df-excel-table th:nth-child(3){width:27%}.df-excel-table th:nth-child(4){width:27%}.df-excel-table th:nth-child(5){width:5%}.df-excel-table th:nth-child(6){width:3%}
.df-excel-table .df-date{font-size:9px;font-weight:600;white-space:nowrap;text-align:center}
.df-checkcell{display:flex;align-items:flex-start;gap:3px;font-size:10px;line-height:1.2}
.df-checkcell input{width:12px;height:12px;min-width:12px;margin:1px 0 0}
.df-done{text-decoration:line-through;opacity:.55}
.df-progress{text-align:center;font-size:9px;white-space:nowrap}
.df-actions{white-space:nowrap;text-align:center}
.df-actions button{font-size:8px;min-height:22px;padding:2px 3px;margin:1px;border:0;background:transparent}
.df-empty{text-align:center;padding:16px!important}
@media(max-width:430px){
 .df-excel-table{font-size:9px}
 .df-excel-table th,.df-excel-table td{padding:3px 2px}
 .df-excel-table th:first-child{width:12%}.df-excel-table th:nth-child(2){width:28%}.df-excel-table th:nth-child(3){width:28%}.df-excel-table th:nth-child(4){width:28%}.df-excel-table th:nth-child(5){width:4%}.df-excel-table th:nth-child(6){display:none}
 .df-actions{display:none}
 .df-checkcell{font-size:9px}
}

/* V8.17 visible edit control */
.df-excel-table .df-actions{width:38px;text-align:center}
.df-excel-table .df-actions button{display:inline-block;font-size:8px;min-height:22px;padding:2px 4px}
@media(max-width:430px){.df-excel-table .df-actions{display:table-cell;width:32px}.df-excel-table .df-actions button{font-size:7px;padding:2px}}

/* 2-hour streak home card */
.streak-home{margin-top:10px}.streak-home .ring{width:54px;height:54px}


/* V8.21 Statistics trend boxes */
.trend-card{overflow:hidden}
.trend-box{margin-top:12px;min-height:190px;padding:12px 10px 8px;border:1px solid rgba(115,87,245,.14);border-radius:16px;background:rgba(115,87,245,.035);overflow:hidden}
.trend-chart{width:100%;min-width:0;overflow:hidden}
.trend-box .stats-bars{height:150px;display:flex;align-items:flex-end;gap:5px;overflow:hidden;padding:4px 2px 0}
.trend-box .stats-bar-col{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px}
.trend-box .stats-bar-track{height:108px;width:min(100%,24px);background:rgba(115,87,245,.09);border-radius:8px 8px 4px 4px;display:flex;align-items:flex-end;overflow:hidden}
.trend-box .stats-bar-track i{display:block;width:100%;min-height:3px;border-radius:8px 8px 3px 3px;background:linear-gradient(180deg,#8068f6,#5d46d8)}
.trend-box .stats-bar-value{font-size:9px;font-weight:700;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.trend-box .stats-bar-label{font-size:8px;white-space:nowrap;transform:none;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.trend-box.empty{display:flex;align-items:center;justify-content:center;color:var(--muted,#777);font-size:12px}
@media(max-width:430px){.trend-box{min-height:175px;padding:9px 5px}.trend-box .stats-bars{gap:2px;height:142px}.trend-box .stats-bar-track{width:min(100%,19px);height:98px}.trend-box .stats-bar-value{font-size:8px}.trend-box .stats-bar-label{font-size:7px}}
.clear-data-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.clear-data-grid button{border:1px solid rgba(0,0,0,.08);background:rgba(255,255,255,.65);border-radius:12px;padding:10px;font-weight:700;text-align:left}.quiz-option{display:block;width:100%;margin:8px 0;padding:12px 14px;border:1px solid rgba(0,0,0,.08);background:rgba(255,255,255,.72);border-radius:12px;text-align:left;font-size:14px}.quiz-option.correct{border-color:#3ca66a;background:rgba(60,166,106,.12)}.quiz-option.wrong{border-color:#d34b67;background:rgba(211,75,103,.10)}.quiz-result{text-align:center;padding:10px}.study-item button{margin-left:6px}.study-item .row{align-items:flex-start}@media(max-width:520px){.clear-data-grid{grid-template-columns:1fr}.study-item .row{flex-wrap:wrap}.study-item .grow{min-width:100%}}

/* V15 shared Study ↔ Timetable controls */
.tt-study-slot{padding:10px 12px;margin:8px 0;border:1px solid rgba(115,87,245,.12);border-radius:14px;background:rgba(115,87,245,.035)}
.tt-study-slot label{margin-top:6px}
.tt-study-slot select{width:100%}

/* V31.2 Habits */
.habit-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}.habit-summary>div{padding:10px;border-radius:12px;background:rgba(115,87,245,.055);text-align:center}.habit-summary b{display:block;font-size:20px}.habit-summary span{font-size:10px;color:var(--muted,#777)}.habit-card{padding:12px;margin:9px 0;border:1px solid rgba(115,87,245,.14);border-radius:14px;background:rgba(255,255,255,.38)}.habit-week{margin-top:9px}.habit-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin-top:5px}.habit-day{min-height:32px!important;padding:4px!important;border:1px solid rgba(115,87,245,.15);border-radius:8px;background:transparent;font-size:11px}.habit-day.done{background:rgba(60,166,106,.16);border-color:rgba(60,166,106,.4);font-weight:800}.habit-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:8px}.habit-actions button{min-height:30px;padding:5px 9px;font-size:11px;border:0;border-radius:9px;background:rgba(115,87,245,.08)}

/* Day Flow V33 Adaptive Study */
.v33-hero{border:1px solid rgba(120,120,120,.18)}
.v33-hero .study-kpi b{font-size:1.25rem}
.study-tabs{overflow-x:auto;white-space:nowrap}
.study-tabs button{flex:0 0 auto}

/* V34 ULTIMATE UI - additive styles; existing styles preserved */
.v34-shell button{font:inherit}.v34-shell input,.v34-shell textarea,.v34-shell select{max-width:100%}
