:root {
  --bg-gradient: linear-gradient(180deg, #F0F4F9 0%, #FFFFFF 100%);
  --surface-white: #FFFFFF;
  --primary-blue: #00439C;
  --primary-blue-dark: #002D6B;
  --accent-cyan: #00A3FF;
  --text-dark: #0F172A;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --card-shadow: 0px 4px 16px rgba(15, 23, 42, 0.05);
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }

body { background-color: #E2E8F0; display: flex; justify-content: center; min-height: 100vh; }

.app-container {
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: var(--bg-gradient);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.app-header { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.header-branding { display: flex; align-items: center; gap: 10px; }
.header-titles .university-name { font-size: 18px; font-weight: 800; color: var(--primary-blue-dark); line-height: 1.1; }
.header-titles .university-sub { font-size: 11px; color: var(--text-muted); }
.header-right-actions { display: flex; align-items: center; gap: 12px; }
.user-initials-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-blue-dark); color: white; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.bell-btn { background: none; border: none; position: relative; cursor: pointer; }
.bell-dot { position: absolute; top: 1px; right: 2px; width: 8px; height: 8px; background-color: #EF4444; border-radius: 50%; border: 1.5px solid white; }

.app-content { flex: 1; overflow-y: auto; padding: 12px 16px 80px 16px; }
.tab-screen { display: none; }
.tab-screen.active { display: block; }

.greeting-title { font-size: 24px; font-weight: 800; color: var(--text-dark); }
.greeting-date { font-size: 13px; color: var(--text-muted); margin-top: 2px; margin-bottom: 14px; }

/* Баннер ИИ */
.ai-hero-banner {
  background: linear-gradient(135deg, #002352 0%, #00439C 60%, #0066FF 100%);
  border-radius: var(--radius-xl);
  padding: 20px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0px 8px 20px rgba(0, 67, 156, 0.25);
  margin-bottom: 16px;
  cursor: pointer;
}
.banner-heading { font-size: 20px; font-weight: 700; line-height: 1.2; }
.banner-subheading { font-size: 12px; opacity: 0.8; margin: 6px 0 14px 0; }
.banner-ai-btn { background: white; color: var(--primary-blue-dark); border: none; padding: 8px 16px; border-radius: 20px; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.section-heading { font-size: 18px; font-weight: 700; color: var(--text-dark); }
.link-btn { background: none; border: none; color: var(--accent-cyan); font-weight: 600; font-size: 13px; cursor: pointer; }

/* Селектор группы */
.group-select-dropdown-wrap { display: inline-flex; align-items: center; background: #E2E8F0; padding: 6px 14px; border-radius: 20px; gap: 6px; margin-bottom: 12px; }
.group-select-input { background: transparent; border: none; font-weight: 700; color: var(--text-dark); font-size: 13px; outline: none; cursor: pointer; }

/* Карточка пары */
.today-schedule-card { background: var(--surface-white); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--card-shadow); border: 1px solid var(--border-light); margin-bottom: 16px; }
.timeline-item { display: flex; gap: 12px; margin-bottom: 8px; }
.timeline-indicator { display: flex; flex-direction: column; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-light); }
.dot.active { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }
.line { width: 2px; flex: 1; background: var(--border-light); margin: 4px 0; }
.pair-details-box { flex: 1; padding: 12px; border-radius: var(--radius-md); }
.active-bg { background: #EBF5FF; border-left: 3px solid var(--accent-cyan); }
.muted-bg { background: #F8FAFC; }
.pair-time { font-size: 12px; font-weight: 700; color: var(--primary-blue); }
.pair-name { font-size: 14px; font-weight: 700; color: var(--text-dark); margin: 2px 0; }
.pair-meta { font-size: 11px; color: var(--text-muted); }
.pair-compact { font-size: 13px; color: var(--text-muted); }

/* Плитки сервисов */
.two-column-services { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.service-tile { background: var(--surface-white); border-radius: var(--radius-lg); padding: 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--card-shadow); border: 1px solid var(--border-light); cursor: pointer; }
.tile-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.custom-svg { width: 24px; height: 24px; }
.tile-label { font-size: 12px; font-weight: 700; color: var(--text-dark); }

/* Новости */
.news-chips-row { display: flex; gap: 8px; margin-bottom: 12px; }
.news-chip { padding: 6px 16px; border-radius: 20px; border: none; background: #E2E8F0; color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.news-chip.active { background: var(--primary-blue-dark); color: white; }
.news-card { background: var(--surface-white); border-radius: var(--radius-lg); padding: 12px; display: flex; gap: 12px; box-shadow: var(--card-shadow); border: 1px solid var(--border-light); cursor: pointer; margin-bottom: 8px; }
.news-image-placeholder { width: 60px; height: 50px; background: #00439C; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.news-bg-icon { width: 28px; height: 28px; }
.news-card-title { font-size: 13px; font-weight: 700; color: var(--text-dark); }
.news-card-sub { font-size: 11px; color: var(--text-muted); }

/* FAQ стили */
.faq-category-title { font-size: 12px; font-weight: 700; color: var(--primary-blue); margin: 12px 0 6px 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.faq-item { cursor: pointer; margin-bottom: 8px; transition: all 0.2s; }
.faq-question-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-dark); }
.chevron { font-size: 16px; color: var(--text-muted); transition: transform 0.2s; }
.faq-item.open .chevron { transform: rotate(90deg); color: var(--primary-blue); }
.faq-answer { display: none; margin-top: 8px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border-light); padding-top: 8px; line-height: 1.4; }
.faq-item.open .faq-answer { display: block; }
.source-link { color: var(--primary-blue); text-decoration: none; font-weight: 600; display: inline-block; margin-top: 6px; }

/* Дни недели */
.days-scroll-row { display: flex; gap: 6px; margin-bottom: 12px; }
.day-chip { flex: 1; padding: 8px 0; border-radius: 10px; border: 1px solid var(--border-light); background: white; color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; }
.day-chip.active { background: var(--primary-blue); color: white; border-color: var(--primary-blue); }

.card-box { background: white; padding: 16px; border-radius: var(--radius-lg); box-shadow: var(--card-shadow); }
.light-input { width: 100%; padding: 10px; border: 1px solid var(--border-light); border-radius: 8px; margin-top: 4px; font-size: 14px; outline: none; }
.primary-blue-btn { width: 100%; padding: 12px; background: var(--primary-blue); color: white; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; }
.muted-text { font-size: 12px; color: var(--text-muted); }

/* Нижнее меню */
.bottom-tab-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 64px; background: var(--surface-white); border-top: 1px solid var(--border-light); display: flex; justify-content: space-around; align-items: center; }
.tab-item { background: none; border: none; display: flex; flex-direction: column; align-items: center; color: var(--text-muted); cursor: pointer; }
.tab-item.active { color: var(--primary-blue); }
.tab-icon, .tab-custom-icon { width: 22px; height: 22px; }
.tab-label { font-size: 10px; margin-top: 2px; font-weight: 500; }

.kgtu-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.header-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Интеграция макета Смирновой: адаптивность, формы и реальные состояния данных. */
[hidden] { display: none !important; }
body { background: #edf2f8; color: var(--text-dark); }
button, input, select { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: rgba(0,67,156,.1); }
button, summary, a { touch-action: manipulation; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid #00a3ff; outline-offset: 3px; }
a { color: var(--primary-blue); }
.app-container { max-width: 520px; height: 100vh; height: 100dvh; background: linear-gradient(180deg,#f1f5fa 0%,#f8fafd 70%); }
.app-header { padding: 15px 22px 12px; min-height: 76px; background: rgba(247,250,253,.92); flex-shrink: 0; }
.header-logo-img { width: 40px; height: 46px; object-fit: contain; }
.header-titles .university-name { font-size: 21px; letter-spacing: .02em; }
.header-titles .university-sub { font-size: 11px; }
.user-initials-avatar { border: 0; width: 39px; height: 39px; font-size: 12px; box-shadow: 0 3px 8px #00336d20; }
.app-content { padding: 16px 22px 24px; overscroll-behavior-y: contain; scrollbar-width: thin; }
.screen { animation: appear .18s ease-out; }
@keyframes appear { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { font-size: 9px; letter-spacing: .16em; font-weight: 750; color: #74869a; margin-bottom: 8px; }
.greeting-title { font-size: 28px; letter-spacing: -.7px; }
.greeting-date { margin-top: 6px; margin-bottom: 22px; font-size: 12px; }
.ai-hero-banner { text-decoration: none; min-height: 183px; padding: 24px; position: relative; overflow: hidden; background: linear-gradient(125deg,#052751,#004aa2 75%,#0069d3); box-shadow: 0 9px 18px #003a851c; margin-bottom: 25px; }
.ai-hero-banner:after { content: ''; position: absolute; width: 190px; height: 190px; border: 1px solid #ffffff16; border-radius: 50%; right: -65px; bottom: -80px; }
.banner-content { z-index: 1; min-width: 0; }
.banner-heading { font-size: 25px; line-height: 1.15; letter-spacing: -.5px; }
.banner-subheading { max-width: 210px; font-size: 11px; line-height: 1.6; margin: 10px 0 18px; }
.banner-ai-btn { display: inline-flex; font-size: 11px; padding: 9px 13px; gap: 14px; }
.banner-illustration { opacity: .9; margin-left: 8px; }
.section-heading { font-size: 17px; letter-spacing: -.3px; }
.section-header { gap: 10px; }
.link-btn { color: var(--primary-blue); font-size: 11px; padding: 8px 0 8px 8px; white-space: nowrap; }
.spaced { margin-top: 26px; }
.today-schedule-card { margin-top: 4px; padding: 17px; }
.today-schedule-card p { margin: 12px 0 6px; line-height: 1.65; }
.pill { display: inline-flex; padding: 5px 10px; border-radius: 8px; background: #edf4fc; color: #23578d; font-size: 11px; font-weight: 700; }
.text-action { display: inline-block; padding: 9px 0; background: none; border: 0; font-size: 12px; text-decoration: none; color: var(--primary-blue); font-weight: 650; cursor: pointer; }
.service-tile { text-align: left; min-height: 77px; }
.tile-label { line-height: 1.6; font-size: 11px; }
.custom-svg { width: 31px; height: 31px; flex-shrink: 0; }
.bottom-tab-bar { position: static; flex-shrink: 0; min-height: calc(69px + env(safe-area-inset-bottom)); height: auto; padding: 7px 9px calc(7px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px #0b356005; }
.tab-item { min-height: 48px; min-width: 0; flex: 1; gap: 2px; border-radius: 12px; padding: 4px 1px; opacity: .65; }
.tab-item.active { background: #eff5ff; opacity: 1; }
.tab-label { font-size: 9px; white-space: nowrap; }
.tab-symbol { height: 24px; font-size: 28px; line-height: 21px; font-weight: 500; }
.tab-custom-icon { width: 24px; height: 24px; }
.page-title { font-size: 28px; line-height: 1.2; letter-spacing: -.8px; margin-bottom: 8px; }
.page-intro { color: var(--text-muted); font-size: 12px; line-height: 1.6; margin-bottom: 20px; }
.result-list { display: grid; gap: 12px; margin-top: 14px; }
.news-chips-row { flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.news-chip { font-size: 11px; padding: 8px 13px; }
.news-card { text-decoration: none; display: block; padding: 16px; margin: 0 0 10px; }
.news-card-title { font-size: 14px; line-height: 1.55; margin: 7px 0; }
.news-card-sub { font-size: 10px; line-height: 1.6; }
.news-category { font-size: 9px; letter-spacing: .05em; color: #3272ac; font-weight: 750; }
.news-card-footer { display: flex; justify-content: space-between; color: #7692b1; font-size: 10px; margin-top: 14px; }
.card-box { border: 1px solid #e4ebf3; }
fieldset { border: 0; min-width: 0; }
legend { font-size: 17px; font-weight: 750; margin-bottom: 14px; color: #1c3c60; }
label { display: block; font-size: 12px; line-height: 1.6; color: #40556d; font-weight: 600; }
.light-input { margin: 5px 0 14px; min-height: 44px; background: #fbfcfe; border-color: #dce5ef; border-radius: 10px; font-size: 16px; color: #193b5b; }
input[type=date] { min-width: 0; max-width: 100%; }
.primary-blue-btn { display: block; text-decoration: none; text-align: center; line-height: 1.5; font-size: 12px; padding: 12px 8px; margin-top: 6px; }
.profile-card { margin-top: 18px; padding: 20px; }
.profile-card p { font-size: 12px; line-height: 1.65; margin-bottom: 12px; }
.profile-note, .footnote { font-size: 11px; line-height: 1.7; color: var(--text-muted); margin: 18px 0; }
#profile-status { font-size: 12px; line-height: 1.7; color: var(--text-muted); margin: 12px 0; }
.account-name { font-size: 20px; color: #183d63; margin-bottom: 16px; }
.secondary-button { padding: 12px; border: 1px solid #c8d9ed; border-radius: 10px; color: #205c99; background: #f3f7fd; font-size: 12px; }
#retry-login { margin-top: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }
.form-row > div { min-width: 0; }
.stacked-form { margin-bottom: 12px; }
.search-form { display: flex; align-items: center; position: relative; margin-bottom: 16px; }
.search-form input { padding-right: 44px; margin: 0; font-size: 13px; }
.search-button { position: absolute; right: 8px; border: 0; background: #e8f1fd; border-radius: 8px; width: 31px; height: 31px; color: #00439c; }
.faq-item { padding: 16px; margin: 0; }
.faq-item summary { font-size: 13px; font-weight: 700; line-height: 1.7; cursor: pointer; }
.faq-item .answer { white-space: pre-wrap; font-size: 12px; line-height: 1.8; color: #526a83; padding-top: 12px; }
.answer-link { color: #00439c; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; word-break: break-word; }
.faq-item .source-link { font-size: 11px; overflow-wrap: anywhere; }
.support-card { margin-top: 24px; padding: 20px; }
.support-card h3 { font-size: 17px; margin-bottom: 9px; }
.support-card p { line-height: 1.8; margin-bottom: 14px; }
.connection-card { margin: 24px 0 0; color: #6a8199; font-size: 11px; }
.connection-card summary { cursor: pointer; padding: 8px 0; }
.connection-card p { line-height: 1.7; }
.lesson-card h3 { font-size: 15px; line-height: 1.6; margin: 8px 0; }
.lesson-card p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 12px; }
.lesson-time { font-size: 12px; color: #00439c; font-weight: 700; }
.empty-state { border: 1px dashed #cfdeed; background: #f5f9fd; border-radius: 14px; padding: 20px; color: #526c87; line-height: 1.8; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (min-width: 600px) { .app-container { border-left: 1px solid #dde6ef; border-right: 1px solid #dde6ef; } }
@media (max-width: 350px) { .app-header { padding: 12px 15px; } .app-content { padding: 14px 15px 20px; } .banner-heading { font-size: 22px; } .banner-illustration { display: none; } .two-column-services { gap: 8px; } .service-tile { padding: 11px; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } * { transition: none !important; } }

.help-modes { display: flex; gap: 4px; padding: 4px; margin: 0 0 18px; border: 1px solid #dce6f2; border-radius: 12px; background: #eaf0f8; }
.help-mode { flex: 1; border: 0; border-radius: 9px; padding: 10px 6px; color: #5c7490; font-size: 11px; font-weight: 650; background: transparent; cursor: pointer; }
.help-mode.active { color: #00439c; background: white; box-shadow: 0 2px 6px #17427412; }
.material-card h3 { font-size: 15px; line-height: 1.6; margin: 8px 0; }
.material-text { font-size: 12px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; color: #526a83; }
.material-card .source-link { font-size: 12px; margin-top: 12px; }

/* Главная: полное название КГТУ, сегодняшний день и фотографии публикаций. */
.header-branding { min-width: 0; gap: 9px; }
.header-titles { min-width: 0; }
.header-titles .university-full-name { display: block; font-size: 11px; line-height: 1.45; margin-top: 3px; color: #475c73; white-space: nowrap; }
.header-titles .university-sub { display: block; font-size: 10px; line-height: 1.5; color: #71849b; }
.header-right-actions { gap: 13px; margin-left: 10px; flex-shrink: 0; }
.bell-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 38px; padding: 0; color: #183f68; }
.bell-btn:disabled { opacity: .7; }
.home-schedule-toolbar { display: flex; align-items: center; gap: 12px; margin: 1px 0 15px; }
.group-select-dropdown-wrap { margin: 0; padding: 7px 10px; background: #e7eef6; gap: 8px; color: #203d5d; min-width: 0; }
.group-select-input { max-width: 195px; min-height: 26px; font-size: 13px; border-radius: 5px; }
select:focus-visible { outline: 3px solid #00a3ff; outline-offset: 3px; }
.home-schedule-toolbar .group-select-dropdown-wrap { flex: 1 1 145px; }
.home-schedule-toolbar .group-select-input { min-width: 0; width: 100%; max-width: 100%; }
.home-subgroup { flex: 0 1 135px; min-width: 0; min-height: 40px; padding: 7px; border: 1px solid #dce6f2; border-radius: 12px; background: #e7eef6; font-size: 11px; color: #203d5d; }
.week-day { display: grid; gap: 10px; }
.week-day + .week-day { margin-top: 12px; }
#schedule-week { margin-top: 10px; width: 100%; }
.home-timetable { margin-bottom: 22px; }
#home-schedule:not(:empty) { line-height: 1.8; border: 1px solid #e0e9f3; border-radius: 14px; padding: 16px; background: #f9fbfe; }
#home-schedule:not(:empty) + .schedule-timeline:not(:empty) { margin-top: 12px; }
.schedule-timeline { padding-left: 20px; position: relative; }
.home-lesson { position: relative; border-radius: 14px; background: white; border: 1px solid #e4ecf5; padding: 14px 16px; margin-bottom: 9px; }
.home-lesson:before { content: ''; position: absolute; width: 7px; height: 7px; background: #eaf0f7; border: 2px solid #bfcfdf; border-radius: 50%; left: -21px; top: 20px; z-index: 1; }
.home-lesson:not(:last-child):after { content: ''; position: absolute; left: -17px; top: 30px; bottom: -20px; width: 2px; background: #dce6f0; }
.home-lesson-featured { background: linear-gradient(110deg,#e7f6ff,#dbf0ff); border-color: #d7edfd; }
.home-lesson-featured:before { border-color: #00a3e9; background: #00a3e9; }
.home-lesson .pair-time { font-size: 14px; line-height: 1.6; color: #0788d0; }
.home-lesson .pair-name { font-size: 16px; line-height: 1.45; margin: 3px 0 5px; overflow-wrap: anywhere; }
.home-lesson .pair-meta { font-size: 11px; line-height: 1.7; }
.home-news-topics { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 15px 0; padding: 2px 1px 5px; }
.home-news-topics::-webkit-scrollbar { display: none; }
.home-news-topics .news-chip { flex-shrink: 0; }
.news-card { display: flex; align-items: center; gap: 15px; padding: 12px; }
.news-picture { width: 94px; height: 102px; border-radius: 11px; flex-shrink: 0; overflow: hidden; background: linear-gradient(140deg,#edf5ff,#e1ecf7); position: relative; }
.news-picture img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.news-picture img.news-picture-icon { object-fit: contain; width: 30px; height: 34px; inset: 50% auto auto 50%; transform: translate(-50%,-50%); opacity: .5; }
.news-picture.has-photo .news-picture-icon { display: none; }
.news-card-content { min-width: 0; flex: 1; }
.news-card-title { font-size: 13px; line-height: 1.55; margin: 6px 0; overflow-wrap: anywhere; }
.news-card-footer { font-size: 9px; line-height: 1.5; flex-wrap: wrap; gap: 3px 8px; margin-top: 9px; }
@media (max-width: 350px) {
 .app-header { padding-left: 13px; padding-right: 13px; }
 .header-logo-img { width: 30px; height: 42px; }
 .header-branding { gap: 7px; }
 .header-titles .university-name { font-size: 20px; }
 .header-titles .university-full-name { font-size: 9px; }
 .header-right-actions { gap: 7px; margin-left: 6px; }
 .user-initials-avatar { width: 34px; height: 34px; }
 .bell-btn { width: 24px; }
 .group-select-input { max-width: 165px; }
 .news-picture { width: 72px; height: 98px; }
 .news-card { gap: 10px; }
 .news-card-title { font-size: 12px; }
}


/* Разделители и увеличенная эмблема по согласованному варианту шапки. */
.header-logo-img { width: 52px; height: 62px; flex-shrink: 0; }
.header-branding { gap: 10px; }
.header-divider { display: block; flex: 0 0 1px; width: 1px; height: 42px; background: #cdd8e4; }
.header-right-actions { gap: 10px; margin-left: 9px; }
.header-right-actions .header-divider { height: 30px; }
@media (max-width: 350px) {
 .header-logo-img { width: 40px; height: 52px; }
 .header-branding, .header-right-actions { gap: 7px; }
 .header-branding .header-divider { height: 38px; }
 .header-right-actions { margin-left: 6px; }
}
