:root {
  --ink: #242135;
  --ink-soft: #747084;
  --paper: #f7f6fb;
  --surface: rgba(255, 255, 255, 0.88);
  --line: rgba(54, 45, 90, 0.09);
  --accent: #ffd86e;
  --accent-dark: #46350b;
  --purple: #6d5ce7;
  --peach: #ff987a;
  --mint: #8ce0ca;
  --danger: #df624e;
  --shadow: 0 14px 36px rgba(61, 51, 103, 0.08);
  --radius: 28px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(140, 224, 202, 0.34), transparent 26rem),
    radial-gradient(circle at 92% 9%, rgba(255, 152, 122, 0.2), transparent 22rem),
    var(--paper);
  font-family: "Segoe UI Variable", "Segoe UI", "Trebuchet MS", sans-serif;
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 70px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 251, 0.78);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: -0.04em; font-size: 19px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 14px 14px 14px 5px; background: linear-gradient(145deg, var(--purple), #9a85ff); color: white; font-size: 13px; letter-spacing: -0.08em; box-shadow: 0 8px 20px rgba(109, 92, 231, .28); }
.topbar-actions, .panel-actions { display: flex; align-items: center; gap: 10px; }
.group-button { display: inline-flex; align-items: center; gap: 8px; color: var(--purple); background: #f0edff; border-color: transparent; }
.live-dot { width: 8px; height: 8px; flex: 0 0 auto; display: inline-block; border-radius: 50%; background: #20b486; box-shadow: 0 0 0 4px rgba(32,180,134,.12); }

.shell { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 80px; }
.day-header { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 800; color: var(--ink-soft); font-size: 11px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(32px, 4vw, 46px); line-height: 1; font-weight: 850; letter-spacing: -0.055em; margin-bottom: 10px; }
h2 { font-size: 24px; line-height: 1.1; font-weight: 820; letter-spacing: -0.04em; margin-bottom: 0; }
.day-subtitle { color: var(--ink-soft); margin: 0; max-width: 620px; line-height: 1.6; }

.date-nav { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.75); padding: 5px; box-shadow: var(--shadow); }
.date-nav a { color: var(--ink); text-decoration: none; min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; font-weight: 700; }
.date-nav .date-today { padding: 0 14px; background: #eeebff; color: var(--purple); }

.summary-grid { display: grid; grid-template-columns: 1.45fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.summary-card { background: var(--surface); border: 1px solid rgba(255,255,255,.9); border-radius: 24px; padding: 20px 22px; min-height: 142px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.summary-primary { background: linear-gradient(135deg, #6957df, #8b78f0); color: white; border-color: transparent; position: relative; overflow: hidden; }
.summary-primary::after { content: "✦"; position: absolute; right: 24px; bottom: 10px; color: rgba(255,255,255,.2); font-size: 86px; transform: rotate(13deg); }
.summary-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); }
.summary-primary .summary-label, .summary-primary small { color: #bbc2cf; }
.summary-card strong { font-size: 27px; font-weight: 850; letter-spacing: -0.04em; z-index: 1; }
.summary-card p { margin: 0; font-weight: 700; z-index: 1; }
.summary-card small { color: var(--ink-soft); z-index: 1; }
.progress { height: 7px; background: #e8e6df; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--peach), var(--accent)); border-radius: inherit; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, 0.8fr); gap: 14px; align-items: start; }
.panel { background: var(--surface); border: 1px solid rgba(255,255,255,.85); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.timeline-panel, .focus-panel, .tasks-panel { padding: 28px; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 28px; }
.schedule-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: -14px 0 20px 104px; }
.schedule-legend span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 850; }
.schedule-legend span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.legend-lecture { color: #6553d8; background: #efedff; }
.legend-practice { color: #d96642; background: #fff0ea; }
.legend-lab { color: #12805f; background: #e8f8f2; }

.button { border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer; font-weight: 800; transition: transform 150ms ease, box-shadow 150ms ease; }
.button:hover { transform: translateY(-1px); }
.button-dark { color: white; background: linear-gradient(135deg, var(--purple), #8170ed); box-shadow: 0 8px 18px rgba(109, 92, 231, 0.22); }
.button-ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button-accent { color: var(--accent-dark); background: linear-gradient(135deg, #ffe28a, var(--accent)); box-shadow: 0 8px 20px rgba(255, 216, 110, .25); }
.button-wide { width: 100%; padding: 14px 18px; }
.text-button { border: 0; padding: 8px; color: var(--ink); background: transparent; font-weight: 800; cursor: pointer; }

.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 79px; top: 22px; bottom: 22px; width: 2px; background: #ebe8f5; }
.timeline-item { display: grid; grid-template-columns: 60px 16px 1fr auto; gap: 14px; align-items: center; min-height: 96px; }
.timeline-time { display: flex; flex-direction: column; font-size: 13px; }
.timeline-time span { color: var(--ink-soft); margin-top: 5px; }
.timeline-dot { width: 13px; height: 13px; border: 3px solid var(--surface); border-radius: 50%; background: var(--item-color); box-shadow: 0 0 0 1px var(--item-color); z-index: 1; }
.timeline-content { margin: 6px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(249,248,253,.82); }
.type-lecture .timeline-content { border-color: rgba(109,92,231,.2); background: linear-gradient(120deg, rgba(239,237,255,.88), rgba(255,255,255,.88)); }
.type-practice .timeline-content { border-color: rgba(255,138,99,.24); background: linear-gradient(120deg, rgba(255,240,234,.9), rgba(255,255,255,.88)); }
.type-lab .timeline-content { border-color: rgba(24,167,124,.22); background: linear-gradient(120deg, rgba(232,248,242,.9), rgba(255,255,255,.88)); }
.kind-task .timeline-content { box-shadow: inset 4px 0 0 var(--item-color); background: white; }
.timeline-content h3 { font-size: 16px; margin: 4px 0 6px; }
.timeline-content p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.timeline-content .teacher-line { margin-top: 7px; color: #4e4960; font-weight: 700; }
.item-kind { font-size: 10px; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.13em; font-weight: 800; }
.timeline-controls { padding-left: 8px; }
.timeline-item.is-complete { opacity: 0.52; }
.session-check { border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; padding: 8px 10px; cursor: pointer; font-size: 12px; font-weight: 700; }
.lesson-notes { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 11px; }
.lesson-notes summary { display: flex; align-items: center; gap: 8px; width: max-content; list-style: none; cursor: pointer; color: var(--purple); font-size: 12px; font-weight: 800; }
.lesson-notes summary::-webkit-details-marker { display: none; }
.important-summary { display: inline-flex; margin-top: 10px; padding: 5px 8px; border-radius: 8px; color: #8d6100; background: #fff3c9; font-size: 10px; font-weight: 900; }
.note-count { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: #eeeaff; font-size: 10px; }
.notes-body { padding-top: 13px; }
.notes-list { display: grid; gap: 8px; margin-bottom: 10px; }
.note-card { padding: 12px; border-radius: 13px; background: white; border: 1px solid var(--line); }
.note-card.is-important { border-color: #f0cc61; background: #fffbeb; box-shadow: inset 3px 0 0 #e2ad18; }
.note-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.note-top time { color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.note-labels { display: flex; gap: 6px; align-items: center; }
.note-labels span, .note-labels b { padding: 4px 7px; border-radius: 7px; color: var(--ink-soft); background: var(--paper); font-size: 9px; font-weight: 850; }
.note-labels b { color: #8d6100; background: #fff0b7; }
.note-delete { border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 17px; line-height: 1; }
.note-card p { color: var(--ink); line-height: 1.45; white-space: pre-wrap; }
.note-image { display: block; margin-top: 9px; width: min(230px, 100%); }
.note-image img { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 11px; }
.attachment-link { display: inline-flex; margin-top: 9px; color: var(--purple); font-size: 12px; font-weight: 800; text-decoration: none; }
.notes-empty { padding: 12px; border-radius: 12px; background: #f1effb; line-height: 1.45; }
.note-form textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); padding: 11px 12px; outline: none; }
.note-form textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109,92,231,.09); }
.note-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.note-options select { min-width: 160px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; color: var(--ink); background: white; font-size: 11px; }
.important-toggle { display: inline-flex !important; grid-auto-flow: column; align-items: center; gap: 6px; margin: 0 !important; padding: 8px 10px; border-radius: 9px; color: #8d6100 !important; background: #fff7d7; cursor: pointer; }
.important-toggle input { width: auto; margin: 0; accent-color: #d5a30f; }
.note-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.attach-control { position: relative; overflow: hidden; cursor: pointer; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.attach-control input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.attach-control[data-filename]::after { content: attr(data-filename); display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--purple); margin-top: 3px; }
.mini-button { border: 0; border-radius: 9px; padding: 8px 11px; background: var(--purple); color: white; font-size: 11px; font-weight: 800; cursor: pointer; }
.icon-button { border: 0; background: transparent; color: var(--ink-soft); font-size: 22px; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; }
.icon-button:hover { background: #f4e6e3; }
.danger { color: var(--danger); }

.focus-panel { position: sticky; top: 90px; }
.focus-task { border-top: 6px solid var(--subject-color); padding-top: 22px; }
.subject-pill { display: inline-flex; padding: 6px 9px; background: color-mix(in srgb, var(--subject-color) 12%, white); color: var(--subject-color); border-radius: 7px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; }
.focus-task h3 { font-size: 25px; line-height: 1.14; font-weight: 850; letter-spacing: -.04em; margin: 17px 0 10px; }
.focus-task > p { color: var(--ink-soft); line-height: 1.55; }
.focus-meta { margin: 25px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.focus-meta div { padding: 12px 8px; background: var(--paper); border-radius: 10px; }
.focus-meta dt { color: var(--ink-soft); font-size: 10px; text-transform: uppercase; font-weight: 800; margin-bottom: 6px; }
.focus-meta dd { margin: 0; font-size: 12px; font-weight: 800; }
.overdue { color: var(--danger) !important; }
.method-note { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.method-note span { font-size: 12px; font-weight: 900; }
.method-note p { color: var(--ink-soft); font-size: 12px; line-height: 1.55; margin: 8px 0 0; }

.tasks-panel { margin-top: 14px; }
.task-list { display: grid; }
.task-row { display: grid; grid-template-columns: 34px 5px minmax(200px, 1fr) 130px 48px 34px; gap: 14px; align-items: center; padding: 16px 0; border-top: 1px solid #ebe8e0; }
.task-check { width: 26px; height: 26px; border: 1px solid #bbb7ad; border-radius: 8px; background: white; cursor: pointer; color: white; font-weight: 900; }
.task-row.is-complete .task-check { background: var(--ink); border-color: var(--ink); }
.task-row.is-complete .task-main { opacity: 0.5; text-decoration: line-through; }
.subject-line { width: 5px; height: 36px; border-radius: 99px; background: var(--subject-color); }
.task-main h3 { margin: 0 0 4px; font-size: 15px; }
.task-main p, .task-due span { color: var(--ink-soft); font-size: 12px; margin: 0; }
.task-due { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.risk-badge { width: 42px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--paper); font-size: 12px; font-weight: 900; }

.empty-state { min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed #c9c5bb; border-radius: 18px; padding: 35px; background: linear-gradient(145deg, #fff, #f5f3ed); }
.empty-state h3 { font-size: 26px; font-weight: 850; letter-spacing: -.04em; margin: 10px 0; }
.empty-state p { max-width: 430px; color: var(--ink-soft); line-height: 1.6; }
.empty-number { font-size: 44px; font-weight: 850; color: #c9c5df; }
.empty-compact { color: var(--ink-soft); padding: 20px 0; line-height: 1.55; }

.modal { width: min(620px, calc(100% - 28px)); border: 0; border-radius: 22px; padding: 0; color: var(--ink); box-shadow: 0 30px 100px rgba(21, 35, 60, 0.26); }
.modal::backdrop { background: rgba(21, 35, 60, 0.55); backdrop-filter: blur(5px); }
.modal form { padding: 28px; }
.modal-body { padding: 28px; }
.modal-body > form, .modal-body details form { padding: 0; }
.modal-small { max-width: 460px; }
.modal-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 25px; }
.modal-close { background: var(--paper); border: 0; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; font-size: 22px; color: var(--ink-soft); }
.modal label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 800; margin-bottom: 16px; }
.modal input, .modal select, .modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: #fbfaf7; color: var(--ink); padding: 12px 13px; outline: none; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 35, 60, 0.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal .color-input { padding: 5px; height: 48px; }
.choice-fieldset { margin: 0 0 18px; padding: 0; border: 0; }
.choice-fieldset legend { margin-bottom: 9px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.task-class-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.task-class-picker label { display: block; margin: 0; cursor: pointer; }
.task-class-picker input { position: absolute; opacity: 0; pointer-events: none; }
.task-class-picker span { min-height: 72px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #faf9fd; font-size: 17px; transition: transform 140ms, border-color 140ms, box-shadow 140ms; }
.task-class-picker b { font-size: 10px; }
.task-class-picker input:checked + span { transform: translateY(-2px); border-color: currentColor; box-shadow: 0 8px 18px rgba(61,51,103,.1); }
.class-study span { color: #6553d8; } .class-training span { color: #d96642; }
.class-work span { color: #2676bf; }
.class-rest span { color: #12805f; } .class-personal span { color: #a87500; }
.schedule-mode { display: flex; flex-wrap: wrap; gap: 8px; }
.schedule-mode legend { width: 100%; }
.schedule-mode label { display: block; margin: 0; cursor: pointer; }
.schedule-mode input { position: absolute; opacity: 0; pointer-events: none; }
.schedule-mode span { display: block; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: #faf9fd; font-size: 11px; }
.schedule-mode input:checked + span { border-color: #8574e9; color: var(--purple); background: #efedff; font-weight: 850; }
.scheduled-fields.is-hidden { display: none; }
.estimate-field[hidden] { display: none; }
.estimate-field.is-visible { display: grid; }
.sync-intro { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; padding: 15px; margin-bottom: 18px; border-radius: 17px; background: linear-gradient(135deg, #f0edff, #f7f5ff); }
.sync-mark { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px 16px 16px 6px; color: white; background: linear-gradient(145deg, var(--purple), #9b88ff); font-size: 20px; font-weight: 900; }
.sync-intro strong { font-size: 14px; }
.sync-intro p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.sync-form { margin-bottom: 14px; }
.group-input-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.group-input-row .button { white-space: nowrap; }
.input-hint { margin: -8px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.sync-status { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin: 16px 0; border: 1px solid rgba(32,180,134,.18); border-radius: 14px; background: #f0fbf7; }
.sync-status div { display: grid; gap: 3px; }
.sync-status strong { font-size: 12px; }
.sync-status small { color: var(--ink-soft); font-size: 10px; }
.backup-import { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.backup-import summary { cursor: pointer; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.backup-import form { margin-top: 14px; }
.backup-import .button { margin-top: 10px; }
.telegram-next { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start; margin-top: 18px; padding: 13px 14px; border-radius: 14px; background: #f5f7fb; }
.telegram-next span { padding: 5px 8px; border-radius: 8px; color: #287fbc; background: #e6f4ff; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.telegram-next p { margin: 1px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.import-source { display: grid; grid-template-columns: 48px 1fr auto; gap: 13px; align-items: center; padding: 14px; margin-bottom: 14px; border-radius: 16px; border: 1px solid var(--line); }
.import-source.is-ready { background: #f0f9f6; }
.import-source.is-soon { margin-top: 18px; background: #f5f3fb; opacity: .78; }
.import-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: white; color: var(--purple); font-size: 11px; font-weight: 900; box-shadow: 0 6px 16px rgba(61,51,103,.08); }
.import-source strong { font-size: 13px; }
.import-source p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.source-status { align-self: start; padding: 5px 7px; border-radius: 999px; color: #15735a; background: white; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.is-soon .source-status { color: var(--ink-soft); }
.file-drop { min-height: 76px; display: grid !important; place-items: center; position: relative; overflow: hidden; border: 1px dashed #aea7d6; border-radius: 15px; background: #faf9ff; color: var(--purple) !important; cursor: pointer; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop[data-filename]::after { content: attr(data-filename); color: var(--ink); }
.template-link { display: inline-block; margin: -3px 0 3px; color: var(--purple); text-decoration: none; font-size: 12px; font-weight: 800; }
.telegram-settings { margin: 0 28px 28px; padding: 18px; border-radius: 17px; background: linear-gradient(135deg, #eef8ff, #f7fbff); border: 1px solid #dceefb; }
.telegram-settings form { padding: 0; }
.telegram-heading { display: grid; grid-template-columns: 38px 1fr; gap: 11px; align-items: start; }
.telegram-heading > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px 12px 12px 4px; color: white; background: #2aabee; font-weight: 900; }
.telegram-heading strong { font-size: 13px; }
.telegram-heading p, .telegram-hint { margin: 5px 0 14px; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.telegram-button { display: block; margin-top: 14px; color: white; background: #2aabee; text-align: center; text-decoration: none; }
.telegram-connected { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 10px 12px; border-radius: 11px; background: white; font-size: 11px; }
.telegram-settings .text-button { padding: 8px 0 0; }
.telegram-settings button:disabled { opacity: .5; cursor: not-allowed; }
.settings-modal { width: min(600px, calc(100% - 28px)); max-height: 90vh; }
.telegram-settings .notification-form { margin-top: 18px; }
.modal .notification-toggle { display: grid; grid-template-columns: minmax(0, 1fr) 56px; align-items: center; gap: 16px; margin: 0; padding: 12px 0; cursor: pointer; }
.notification-copy { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.notification-toggle strong { color: var(--ink); font-size: 12px; }
.notification-toggle small { color: var(--ink-soft); font-size: 11px; font-weight: 400; line-height: 1.45; }
/* The visual track is a real sibling element: no pseudo-elements on native inputs. */
.notification-switch { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; width: 56px; min-width: 56px; height: 48px; }
.notification-switch input[type="checkbox"] { position: absolute; inset: 0; z-index: 1; opacity: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }
.switch-track { display: block; position: relative; width: 52px; height: 30px; border: 1px solid #808998; border-radius: 99px; background: #818b9d; transition: background 160ms, border-color 160ms; }
.switch-track::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #0003; transition: transform 160ms; }
.notification-switch input:checked + .switch-track { background: #7256d6; border-color: #7256d6; }
.notification-switch input:checked + .switch-track::before { transform: translateX(22px); }
.notification-switch input:focus-visible + .switch-track { outline: 3px solid var(--purple); outline-offset: 3px; }
.switch-caption { color: var(--ink-soft); font-size: 10px; font-weight: 800; line-height: 12px; text-align: center; }
.switch-on, .notification-switch input:checked ~ .switch-caption .switch-off { display: none; }
.notification-switch input:checked ~ .switch-caption .switch-on { display: inline; }
.notification-switch input:disabled ~ span { opacity: .55; }
.modal .notification-master { padding: 14px; background: white; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 20px; }
.notification-group { padding: 5px 0 14px; margin: 0 0 17px; border: 0; border-bottom: 1px solid #dce6f1; }
.notification-group legend { color: var(--ink); font-size: 12px; font-weight: 850; }
.notification-group > label:not(.notification-toggle) { margin: 12px 0 5px; }
.notification-group input[type="time"], .notification-group select { background: white; }
.notification-hint { margin: 6px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.telegram-settings .telegram-test-form { padding: 16px; margin-top: 22px; background: white; border: 1px dashed #99c6e7; border-radius: 15px; }
.telegram-test-form strong { font-size: 13px; }
.telegram-test-form p, .telegram-test-form > small { font-size: 11px; color: var(--ink-soft); line-height: 1.5; }
.telegram-test-form > small { display: block; margin-top: 10px; }
.notification-footer { margin-top: 16px; }

.toasts { position: fixed; z-index: 30; right: 24px; top: 90px; display: grid; gap: 8px; }
.toast { background: var(--ink); color: white; padding: 13px 17px; border-radius: 12px; box-shadow: var(--shadow); transition: opacity 300ms, transform 300ms; }
.toast-error { background: var(--danger); }
.toast-hide { opacity: 0; transform: translateY(-8px); }

@media (max-width: 940px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-primary { grid-column: 1 / -1; }
  .workspace-grid { grid-template-columns: 1fr; }
  .focus-panel { position: static; }
}

@media (max-width: 680px) {
  .topbar { height: 66px; padding: 0 16px; }
  .topbar-actions .button-ghost { display: none; }
  .shell { width: min(100% - 24px, 1440px); padding-top: 30px; }
  .day-header { align-items: start; flex-direction: column; }
  h1 { font-size: 52px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-primary { grid-column: auto; }
  .timeline-panel, .focus-panel, .tasks-panel { padding: 20px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-actions { width: 100%; justify-content: space-between; }
  .timeline-item { grid-template-columns: 52px 14px 1fr; gap: 10px; }
  .timeline::before { left: 68px; }
  .timeline-controls { grid-column: 3; padding: 0 0 12px; }
  .task-row { grid-template-columns: 30px 4px 1fr 32px; }
  .task-due, .risk-badge { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .task-class-picker { grid-template-columns: 1fr 1fr; }
  .schedule-legend { margin-left: 0; }
}
