@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600&family=Noto+Sans+Mono:wght@400;600&display=swap');

@font-face {
  font-family: "Monomakh";
  src: url("/static/fonts/Monomakh-Regular.otf") format("opentype");
  font-display: swap;
}

:root {
  --bg: #f7f6f3;
  --paper: #ffffff;
  --ink: #2f3437;
  --muted: #787f85;
  --muted-underline: rgba(120, 127, 133, 0.55);
  --accent-underline: rgba(47, 111, 235, 0.55);
  --border: #e6e6e3;
  --accent: #2f6feb;
  --accent-soft: #e8f0fe;
  --aside-bg: #ecebe6;
  --quote-bg: rgba(0, 0, 0, 0.03);
  --shadow: 0 1px 2px rgba(15, 15, 15, 0.08);
  --font-body: "Noto Sans", sans-serif;
  --font-mono: "Noto Sans Mono", monospace;
  --topbar-height: 66px;
}

.old-cyrillic {
  font-family: "Monomakh", var(--font-body);
  font-size: 1.3em;
  line-height: 1;
  vertical-align: baseline;
}

html[data-theme="dark"] {
  --bg: #191918;
  --paper: #20211f;
  --ink: #f1f1ef;
  --muted: #a0a4a7;
  --muted-underline: rgba(160, 164, 167, 0.55);
  --accent-underline: rgba(106, 160, 255, 0.55);
  --border: #2f3130;
  --accent: #6aa0ff;
  --accent-soft: #2a3242;
  --aside-bg: #252624;
  --quote-bg: rgba(255, 255, 255, 0.05);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #191918;
    --paper: #20211f;
    --ink: #f1f1ef;
    --muted: #a0a4a7;
    --muted-underline: rgba(160, 164, 167, 0.55);
    --accent-underline: rgba(106, 160, 255, 0.55);
    --border: #2f3130;
    --accent: #6aa0ff;
    --accent-soft: #2a3242;
    --aside-bg: #252624;
    --quote-bg: rgba(255, 255, 255, 0.05);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  font-size: 18px;
  position: relative;
  overflow-x: hidden;
}

.login-page .container {
  margin-bottom: 0;
}

.login-shell {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
  padding: 40px 0;
}

.login-card {
  width: min(420px, 88vw);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 16px;
  font-size: 28px;
}

.login-card .form-row label {
  color: var(--muted);
}

.muted-input {
  opacity: 0.6;
}

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: var(--muted-underline);
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent-underline);
}

.container {
  width: min(1080px, 92vw);
  margin: 0 auto 64px;
}

body.dicts-page .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}

.site-header {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background: var(--paper);
  display: flex;
  align-items: center;
}

.brand {
  width: min(1080px, 92vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  height: 100%;
}

.brand-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand a {
  font-size: 25px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.brand-sub {
  font-size: 15px;
  color: var(--muted);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--accent-soft);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.header-actions-corner {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

body:not(.home-page) .header-actions-corner,
body.home-page .header-actions-corner {
  top: calc((var(--topbar-height) - 36px) / 2);
}

.header-birthday {
  position: absolute;
  top: calc((var(--topbar-height) - 36px) / 2);
  left: 50%;
  transform: translateX(-50%);
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: calc(100% - 220px);
  line-height: 1;
  padding: 0;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
}

.brand a.header-birthday,
.brand a.header-birthday:hover,
.brand a.header-birthday:visited {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.header-birthday.birthday-left {
  top: calc((var(--topbar-height) - 36px) / 2);
  left: 0;
  right: auto;
  transform: none;
  justify-content: flex-start;
  text-align: left !important;
}

.admin-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--paper);
  text-decoration: none;
}

.admin-shortcut .emoji {
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logout-link {
  font-size: 14px;
  color: var(--ink);
  border: 1px solid var(--border);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--paper);
}

.logout-link:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.admin-shortcut:hover {
  background: var(--accent-soft);
}

.theme-icon {
  font-size: 16px;
  line-height: 1;
}

.theme-icon::before {
  content: "🔁";
  color: var(--muted);
}

.theme-icon[data-theme="light"]::before {
  content: "☀️";
  color: var(--ink);
}

.theme-icon[data-theme="dark"]::before {
  content: "🌙";
  color: var(--ink);
}

.hero {
  padding: 28px 0 18px;
}

.hero h1 {
  font-size: clamp(34px, 3.8vw, 46px);
  margin: 0 0 8px;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.muted-text,
.mtd {
  color: var(--muted);
}
aside {
  margin: 6px 0 20px;
  padding: 10px 12px;
  background: var(--aside-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
}

.migration-banner {
  margin-top: 0;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  text-align: center;
}

.migration-banner a {
  text-decoration-color: var(--muted-underline);
}

.migration-banner a:hover {
  text-decoration-color: var(--accent-underline);
}

.birthday-strip {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

body.home-page.has-birthday .birthday-strip {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
}

.birthday-strip-inner {
  width: min(1080px, 92vw);
  height: 100%;
  max-width: calc(100% - 220px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.birthday-strip-inner.birthday-left {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding-left: max(16px, 4vw);
  padding-right: 220px;
  justify-content: flex-start !important;
  text-align: left !important;
}

.birthday-hidden {
  display: none !important;
}

.brand-main-hidden {
  visibility: hidden;
}

.semester-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-action-card {
  background: var(--paper);
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.home-action-card:hover {
  background: var(--accent-soft);
}

.dict-card {
  display: grid;
  align-items: start;
  gap: 4px;
}

.dict-card span {
  font-size: 14px;
  font-weight: 400;
}

.dict-card .muted-text {
  font-size: 14px;
}

.dict-card:hover {
  color: var(--ink);
}

.dict-card:hover span {
  color: var(--ink);
}

.dict-card:hover .muted-text {
  color: var(--muted);
}

.semester-card {
  background: var(--paper);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.semester-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
}

.subject-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.subject-list a {
  display: inline-block;
  padding: 4px 6px;
  border-radius: 6px;
  text-decoration: none;
}

.subject-emoji {
  margin-right: 6px;
}

.audio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.chip-add {
  background: transparent;
  color: var(--muted);
}

.chip-add:hover {
  color: var(--muted);
}

.audio-table-wrap {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.audio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.audio-table th,
.audio-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.audio-table tr:last-child td {
  border-bottom: none;
}

.audio-empty {
  padding: 14px;
  color: var(--muted);
  display: none;
}

.audio-row {
  cursor: pointer;
}

.audio-row:hover {
  background: var(--accent-soft);
}

.dump-row {
  cursor: pointer;
}

.dump-row:hover {
  background: var(--accent-soft);
}

.dump-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-badge {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--paper);
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.audio-player {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.audio-player audio {
  width: 320px;
}

.audio-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.audio-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.audio-admin-list {
  display: grid;
  gap: 16px;
}

.audio-admin-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.audio-admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.dict-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 16px;
  align-items: start;
}

.dict-layout-full {
  min-height: calc(100vh - var(--topbar-height));
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
  margin: 0;
}

.dict-sidebar {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border-right: 1px solid var(--border);
  box-shadow: none;
}

.dict-back-link {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 16px;
}

.dict-sidebar-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 500;
}

.dict-sidebar-description {
  margin: 0 0 8px;
  font-size: 14px;
}

.dict-layout-full .dict-sidebar {
  top: 0;
  align-self: stretch;
  height: calc(100vh - var(--topbar-height));
  max-height: none;
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.dict-layout-full .dict-sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.dict-layout-full .dict-article {
  min-height: calc(100vh - var(--topbar-height));
  height: calc(100vh - var(--topbar-height));
  overflow: auto;
}

.dict-menu-toggle,
.dict-menu-close,
.dict-menu-backdrop {
  display: none;
}

.dict-article .dict-menu-toggle {
  display: none !important;
}

.dict-search-form {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.dict-sidebar-tools {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  margin: 0;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}

.dict-search-form .form-row {
  margin-bottom: 10px;
}

.dict-search-actions {
  display: flex;
  justify-content: flex-end;
}

.dict-entries {
  margin-top: 0;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.dict-entry {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.dict-entry:hover {
  background: var(--accent-soft);
  color: var(--ink);
  text-decoration: none;
}

.dict-entry.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dict-article h2 {
  margin: 0 0 10px;
}

@media (max-width: 720px) {
  .audio-player {
    grid-template-columns: 1fr;
  }

  .audio-player audio {
    width: 100%;
  }

  .dict-layout {
    grid-template-columns: 1fr;
  }

  .dict-layout-full {
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  body.dicts-page .container {
    height: auto;
    overflow: visible;
  }

  .dict-menu-toggle {
    display: inline-flex !important;
    margin: 8px 0 12px;
  }

  .dict-article .dict-menu-toggle {
    display: inline-flex !important;
  }

  .dict-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 80;
  }

  .dict-menu-close {
    display: inline-flex;
    margin-bottom: 10px;
  }

  .dict-sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: min(88vw, 380px);
    height: calc(100vh - var(--topbar-height));
    max-height: none;
    overflow: auto;
    transform: translateX(-102%);
    transition: transform 0.18s ease;
    z-index: 90;
    border-right: 1px solid var(--border);
  }

  .dict-layout-full .dict-sidebar {
    height: calc(100vh - var(--topbar-height));
    overflow: auto;
  }

  .dict-layout-full .dict-article {
    height: auto;
    min-height: auto;
    overflow: visible;
    padding: 0 12px 16px;
  }

  body.dict-menu-open .dict-sidebar {
    transform: translateX(0);
  }

  body.dict-menu-open .dict-menu-backdrop {
    display: block;
  }
}
.subject-list a:hover {
  background: var(--accent-soft);
}

.muted-text {
  color: var(--muted);
}

.breadcrumb {
  display: flex;
  gap: 10px;
  font-size: 15px;
  color: var(--muted);
  margin-top: 20px;
}

.breadcrumb-compact {
  margin-top: 12px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--muted);
  text-decoration: none;
}

.subject-header {
  margin: 10px 0 16px;
}

.subject-header h1 {
  margin: 0 0 6px;
  font-size: 32px;
}

.subject-emoji-large {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 6px;
}

.tabs {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.tab {
  padding: 8px 2px 10px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 16px;
  text-decoration: none;
}

.tab:hover {
  color: var(--ink);
  text-decoration: none;
}

.tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.text-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}

.text-list a {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 6px;
}

.text-list a:hover {
  background: var(--accent-soft);
}

.text-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.text-table th,
.text-table td {
  text-align: left;
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.text-table tr:last-child td {
  border-bottom: none;
}

.text-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text-table .row-link {
  display: block;
  padding: 10px 8px;
  color: var(--ink);
  border-radius: 8px;
  text-decoration: none;
}

.text-table .row-link:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.markdown {
  margin-top: 20px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.markdown-page {
  margin-top: 12px;
  padding: 0;
  width: min(1080px, 92vw);
  margin-left: auto;
  margin-right: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

.markdown h1,
.markdown h2,
.markdown h3 {
  margin-top: 1.2em;
}

.markdown h1 {
  font-size: 38px;
  margin-top: 0;
}

.text-header {
  margin-bottom: 12px;
}

.markdown-body {
  line-height: 1.65;
  font-size: 19px;
  hyphens: auto;
  overflow-wrap: break-word;
  word-break: normal;
  text-align: left;
}

.markdown-body p {
  text-align: justify;
}

.markdown-body .tiebar-right {
  display: inline-block;
  line-height: inherit;
  position: relative;
  left: 0.5em;
  pointer-events: none;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  margin: 14px 0;
  font-size: 0.95em;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  vertical-align: top;
}

.markdown-body th {
  background: var(--quote-bg);
  font-weight: 600;
  text-align: center !important;
  vertical-align: middle;
}

.markdown-body .paren-list {
  margin: 12px 0;
  padding-left: 2.1em;
}

.markdown-body .paren-list > li {
  margin: 6px 0;
}

.markdown-body .paren-list > li::marker {
  content: counter(list-item) ") ";
}

.markdown-body blockquote {
  margin: 16px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--border);
  color: var(--ink);
  background: var(--quote-bg);
  font-size: 22px;
  line-height: 1.5;
}

.markdown-body blockquote.small-quote {
  font-size: 19px;
  line-height: 1.65;
}

.markdown-body pre,
.md-raw {
  background: #f3f3f1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 16px;
  overflow-x: auto;
}

#text-editor.toastui-editor-no-preview .toastui-editor-md-preview,
#text-editor.toastui-editor-no-preview .toastui-editor-md-splitter {
  display: none !important;
}

#text-editor.toastui-editor-no-preview .toastui-editor-md-container {
  width: 100% !important;
}

.site-footer {
  text-align: center;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 15px;
}

.notice {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}

.notice.success {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

.notice.error {
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
}

html[data-theme="dark"] .notice.success {
  background: #1f2a22;
  color: #b7e1c1;
  border-color: #2a3a2f;
}

html[data-theme="dark"] .notice.error {
  background: #2c1f21;
  color: #f1b1b1;
  border-color: #3b2a2c;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .notice.success {
    background: #1f2a22;
    color: #b7e1c1;
    border-color: #2a3a2f;
  }

  html:not([data-theme]) .notice.error {
    background: #2c1f21;
    color: #f1b1b1;
    border-color: #3b2a2c;
  }
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.admin-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.admin-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.form-row {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
  max-width: 100%;
}

.form-row input,
.form-row select,
.form-row textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  max-width: 100%;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  justify-self: start;
  align-self: start;
  width: max-content;
  white-space: nowrap;
}

.upload-status {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.progress-bar.indeterminate {
  width: 30%;
  animation: progress-slide 1.2s ease-in-out infinite;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(150%);
  }
  100% {
    transform: translateX(300%);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-danger {
  background: #c62828;
  border-color: #b71c1c;
  color: #fff;
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.admin-tabs {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.admin-list {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.admin-semester-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-semester h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.admin-subject {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.admin-subject-header,
.admin-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-group-list,
.admin-text-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 10px;
}

.admin-text-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-form {
  display: inline;
}

@media (max-width: 720px) {
  .brand {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .header-birthday {
    font-size: 14px;
  }

  .markdown {
    padding: 20px;
  }

  .markdown-page {
    padding: 0;
    width: 100%;
  }

  .markdown-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .semester-grid {
    grid-template-columns: 1fr;
  }

  .header-actions-corner {
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
  }

  body:not(.home-page) .header-actions-corner,
  body.home-page .header-actions-corner {
    top: calc(((var(--topbar-height) - 32px) / 2) + env(safe-area-inset-top));
  }

  .admin-shortcut {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
}
