:root {
  --bg: #f7f4ef;
  --bg-card: #ffffff;
  --primary: #4d3424;
  --primary-dark: #2f1f14;
  --accent: #c59b55;
  --text: #2a2318;
  --text-muted: #7a6f5e;
  --border: #e3d7c6;
  --danger: #b84031;
  --success: #2f714a;
  --shadow: 0 14px 40px rgba(56, 41, 22, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f9f7f2 0%, #efe7da 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

button, input, textarea, select {
  font: inherit;
}

header {
  background: rgba(77, 52, 36, 0.95);
  color: #fff;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
header h1 { font-size: 1.3rem; }
header h1 a { color: #fff; text-decoration: none; }
header nav { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
header nav a {
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}
header nav a:hover { background: rgba(255, 255, 255, 0.18); }

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}

.hero, .form-box, .card {
  border-radius: 24px;
}

.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(227, 215, 198, 0.9);
  border-radius: 18px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 20px 40px rgba(107, 68, 35, 0.08);
}
.card h3 { color: var(--primary-dark); margin-bottom: 0.75rem; }
.card .meta { color: var(--text-muted); font-size: 0.92rem; }

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

.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
label { font-size: 0.95rem; color: var(--text-muted); }
input, textarea, select {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(227, 215, 198, 0.9);
  border-radius: 14px;
  font-size: 0.98rem;
  background: #fff;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(197, 155, 85, 0.14);
}

.btn {
  background: var(--primary);
  color: #fff;
  padding: 0.85rem 1.35rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.98rem;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 16px 25px rgba(77, 52, 36, 0.12);
}
.btn:hover { background: #3e2920; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: var(--primary-dark); }
.btn-accent:hover { background: #ae843f; }
.btn-sm { padding: 0.7rem 1rem; font-size: 0.9rem; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #962f28; }
.btn-block { width: 100%; }

.alert { border-radius: 16px; }

.invite-code {
  background: rgba(245, 241, 234, 0.92);
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: var(--primary-dark);
  border: 1px dashed rgba(197, 155, 85, 0.8);
}

.event-card { margin-bottom: 1rem; }
.tag {
  display: inline-block;
  background: rgba(197, 155, 85, 0.16);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  margin-right: 0.35rem;
  margin-top: 0.3rem;
}

.calendar-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(100px, auto);
}
.calendar-day-name {
  font-weight: 700;
  color: var(--primary-dark);
  text-align: center;
}
.calendar-cell {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(227, 215, 198, 0.95);
  border-radius: 18px;
  min-height: 100px;
  padding: 0.6rem;
}
.calendar-cell.empty {
  background: transparent;
  border: none;
}
.calendar-cell-header {
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.calendar-event-card {
  background: #f8f2e8;
  border-radius: 14px;
  padding: 0.6rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.calendar-event-card:hover {
  transform: translateY(-1px);
  background: #fff3db;
}

.event-card {
  padding: 1.2rem;
}

.search-box input {
  min-width: 0;
}

@media (max-width: 900px) {
  header { flex-direction: column; align-items: flex-start; }
  .container { margin: 1rem auto; }
  .tabs { gap: 0.4rem; }
  .card { padding: 1.2rem; }
  .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  header { padding: 1rem; }
  .card { padding: 1rem; }
  .calendar-grid { grid-template-columns: 1fr; }
  .form-group { gap: 0.35rem; }
  button, input, textarea, select { font-size: 0.95rem; }

  .note-composer .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .note-form-grid {
    grid-template-columns: 1fr !important;
  }
  .note-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .note-toolbar button,
  .mode-toggle button {
    width: auto;
    min-width: 44px;
    flex: 0 0 calc(33.333% - 0.34rem);
    border-radius: 12px;
    padding: 0.65rem 0.55rem;
    min-height: 42px;
  }
  .note-toolbar button span {
    display: none;
  }
  .note-toolbar button svg {
    width: 18px;
    height: 18px;
  }
  .mode-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .editor-area.note-editor-area {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    min-height: auto;
  }
  .note-pane {
    min-height: 280px;
  }
  .note-pane-editor #noteContentRich {
    min-height: 320px;
    font-size: 17px;
  }
  .note-pane-preview {
    display: none !important;
  }
  .note-editor-area {
    grid-template-columns: 1fr !important;
  }
  .note-pane-editor {
    min-height: 62vh;
  }
  .note-pane-editor #noteContentRich {
    min-height: 58vh;
  }
  .note-actions {
    flex-direction: column;
    gap: 0.6rem;
  }
  .note-actions .btn {
    width: 100%;
  }
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1200;
}
.modal.open { display: block; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 10, 8, 0.56);
}
.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 2rem));
  max-height: min(86vh, 900px);
  margin: 2rem auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-preview {
  padding: 1.25rem;
  overflow: auto;
  flex: 1;
}
.modal-actions { display: flex; gap: 0.5rem; align-items: center; }
.note-preview-snippet {
  margin: 0.8rem 0;
  padding: 0.9rem 1rem;
  background: #f9f5ee;
  border: 1px solid #efe2cb;
  border-radius: 12px;
  max-height: 220px;
  overflow: hidden;
}
.note-preview-snippet p { margin: 0 0 0.5rem; }
.note-preview-snippet ul, .note-preview-snippet ol,
#noteContentRich ul, #noteContentRich ol,
.preview ul, .preview ol,
.modal-preview ul, .modal-preview ol {
  margin: 0 0 0.75rem 1.25rem;
  padding-left: 1.25rem;
}
.note-preview-snippet li,
#noteContentRich li,
.preview li,
.modal-preview li {
  margin-bottom: 0.25rem;
}
.note-table, .note-preview-snippet table, #noteContentRich table, .preview table, .modal-preview table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}
.note-table th, .note-table td,
.note-preview-snippet th, .note-preview-snippet td,
#noteContentRich th, #noteContentRich td,
.preview th, .preview td,
.modal-preview th, .modal-preview td {
  border: 1px solid #d8c8a5;
  padding: 0.6rem 0.75rem;
  min-width: 120px;
  vertical-align: top;
}
.note-preview-snippet table, #noteContentRich table, .preview table, .modal-preview table {
  background: #fff;
}
#noteContentRich td[contenteditable="true"]:focus, .preview td[contenteditable="true"]:focus, .modal-preview td[contenteditable="true"]:focus {
  outline: 2px solid var(--accent);
  background: #fff7e6;
}
#noteContentRich p, .preview p, .modal-preview p {
  margin: 0 0 0.75rem;
}

/* HEADER */
header {
  background: var(--primary);
  color: #fff;
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header h1 { font-size: 1.5rem; }
header h1 a { color: #fff; text-decoration: none; }
header nav a {
  color: #fff;
  margin-left: 1.5rem;
  font-size: 0.95rem;
}
header nav a:hover { color: var(--accent); }

/* CONTAINER */
.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* HERO */
.hero {
  text-align: center;
  padding: 4rem 1rem;
}
.hero h2 {
  font-size: 2.8rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card h3 { color: var(--primary-dark); margin-bottom: 0.5rem; }
.card .meta { color: var(--text-muted); font-size: 0.9rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* FORMS */
.form-box {
  max-width: 420px;
  margin: 3rem auto;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.form-box h2 { text-align: center; margin-bottom: 1.5rem; color: var(--primary-dark); }
.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.3rem; font-size: 0.9rem; color: var(--text-muted); }
input, textarea, select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

/* BUTTONS */
.btn {
  background: var(--primary);
  color: #fff;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  transition: background 0.2s;
}
.btn:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: var(--primary-dark); }
.btn-accent:hover { background: #b89248; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-danger { background: var(--danger); }

/* CHAT */
.chat-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 400px;
  overflow-y: auto;
  padding: 1rem;
  background: #faf7f1;
  margin-bottom: 1rem;
}
.message {
  margin-bottom: 0.8rem;
  padding: 0.5rem 0.8rem;
  background: #fff;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
.message .sender { font-weight: bold; color: var(--primary); font-size: 0.85rem; }
.message .time { color: var(--text-muted); font-size: 0.75rem; margin-left: 0.5rem; }
.message .text { margin-top: 0.2rem; }

.chat-input {
  display: flex;
  gap: 0.5rem;
}
.chat-input input { flex: 1; }

/* INVITE CODE */
.invite-code {
  background: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 1.1rem;
  color: var(--primary-dark);
  border: 1px dashed var(--accent);
  display: inline-block;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 3rem;
}

.note-editor {
  display: grid;
  gap: 1rem;
}
.note-editor textarea {
  min-height: 220px;
}
.note-composer .note-composer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255,255,255,0.96);
  padding-bottom: 0.75rem;
}
.note-toolbar button,
.mode-toggle button {
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.note-toolbar button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}
.note-toolbar button span {
  font-size: 0.9rem;
}
.note-editor-area {
  align-items: start;
}
.note-pane {
  min-height: 320px;
}
.note-pane-editor #noteContentRich {
  font-size: 16px;
  line-height: 1.55;
}
.note-pane-preview .preview {
  font-size: 15px;
  line-height: 1.55;
}
.note-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  background: #fcfaf7;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}
.note-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.3;
}
.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.note-preview {
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
}

/* ===== ROLE BADGE ===== */
.role-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 10px;
  margin-left: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== SEARCH ===== */
.search-box {
  position: relative;
  margin-bottom: 1rem;
}
.search-box input { padding-left: 2.5rem; }
.search-box::before {
  content: "🔍";
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}



/* ===== FAB AND MODAL WINDOW */
.fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 36px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    z-index: 900;
    transition: transform .2s, box-shadow .2s;
}

.fab svg{
    display:block;
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 24px rgba(0,0,0,.3);
}

.fab:active {
    transform: scale(.95);
}

.modal {
  animation: fadeIn 0.2s ease;
  z-index: 99999;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Чтобы на iOS тоже хорошо скроллилось */
#eventModal > div > div {
  -webkit-overflow-scrolling: touch;
}

.modal-overlay{
    position:fixed;
    left:0;
    top:0;
    width:100vw;
    height:100vh;
    background:rgba(0,0,0,.45);
    display:none;
    align-items:center;
    justify-content:center;
    z-index: 99999;
}

.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:1rem;
}

.modal-close{
    background:none;
    border:none;
    font-size:24px;
    cursor:pointer;
    color:#888;
}

.modal-close:hover{
    color:#000;
}

.modal-actions{
    display:flex;
    gap:.5rem;
    justify-content:flex-end;
    margin-top:1rem;
}

/* ===== STREAM ===== */
.stream-card{
    display:flex;
    flex-direction:column;
    gap:1rem;
}

.stream-meta{
    display:flex;
    gap:1rem;
    align-items:flex-start;
    flex-wrap:wrap;
}

.stream-thumb{
    display:block;
    width:100%;
    max-width:320px;
    aspect-ratio:16/9;
    object-fit:cover;
    border-radius:12px;
}

.stream-info{
    display:flex;
    flex-direction:column;
    gap:.5rem;
    flex:1;
    min-width:0;
}

.stream-info-title{
    font-size:1.05rem;
    font-weight:600;
}

.stream-actions{
    display:flex;
    gap:.5rem;
    flex-wrap:wrap;
    margin-top:.5rem;
}

.stream-player{
    margin-top:.5rem;
    border-top:1px solid var(--border-color,#ddd);
    padding-top:1rem;
}

.stream-player summary{
    cursor:pointer;
    font-weight:600;
    user-select:none;
    margin-bottom:.75rem;
}

.stream-player iframe{
    width:100%;
    aspect-ratio:16/9;
    border:none;
    border-radius:12px;
}

.iframe-container iframe{
    width:100%;
    aspect-ratio:16/9;
    border:none;
    border-radius:12px;
}

/* @media (max-width:700px){
    .stream-meta{
        flex-direction:column;
    }
    .stream-thumb{
        width:100%;
        max-width:420px;
    }
} */

@media (max-width:700px){
    .stream-meta{
        flex-direction:column;
    }
    .stream-thumb{
        max-width:100%;
    }
}

/* ===== EVENT GROUP SECTIONS ===== */
.event-section { margin-bottom: 1.5rem; }
.event-section h4 {
  color: var(--primary-dark);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.3rem;
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}

.event-card { margin-bottom: 1rem; }
.tag {
  display: inline-block;
  background: rgba(201, 169, 97, 0.15);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
  margin-right: 0.25rem;
  margin-top: 0.2rem;
}

.calendar-header { margin-bottom: 1rem; }
.calendar-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(7, 1fr);
}
.calendar-day-name {
  font-weight: bold;
  color: var(--primary-dark);
  text-align: center;
}
.calendar-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 110px;
  padding: 0.65rem;
}
.calendar-cell.empty {
  background: transparent;
  border: none;
}
.calendar-cell-header {
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.calendar-event-card {
  background: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.4rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.calendar-event-card:hover { background: #f7f3ec; }



/* ALERTS */
.alert {
  /* padding: 0.8rem 1rem; */
  border-radius: 6px;
  margin-bottom: 1rem;
}

#alert {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  width: 100%;
  max-width: 520px;
  padding: 0 15px;
  pointer-events: none; /* чтобы не мешал кликам под собой */
}

#alert > .alert {
  pointer-events: auto; /* только сам алерт реагирует */
  margin-bottom: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Цвета */
.alert-success {
  background: #e6f4ec;
  color: #1f4a35;
  border: 1px solid #b8dcc6;
}

.alert-error {
  background: #fdecea;
  color: #9c2a1f;
  border: 1px solid #f5c6c2;
}

.alert-warning {
  background: #fff4e5;
  color: #8a5c1f;
  border: 1px solid #ffe4b8;
}

.alert-info {
  background: #e6f0ff;
  color: #1e4a8c;
  border: 1px solid #c6d4f5;
}


/* ===== MOBILE ===== */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    text-align: center;
  }
  header h1 { font-size: 1.2rem; }
  header nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; }
  header nav a {
    margin-left: 0;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
  }

  .container { padding: 0 1rem; margin: 1rem auto; }
  .hero { padding: 2rem 0.5rem; }
  .hero h2 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }

  .form-box { margin: 1rem auto; padding: 1.5rem; }

  .grid { grid-template-columns: 1fr; }
  .chat-box { height: 60vh; }
  .chat-input { flex-direction: column; }
  .chat-input .btn { width: 100%; }

  .card { padding: 1rem; }
  .card h3 { font-size: 1.1rem; }

  .btn { padding: 0.6rem 1rem; font-size: 0.95rem; }
  .btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

  input, textarea, select { font-size: 16px; /* отключает зум iOS */ }
}

@media (max-width: 480px) {
  .hero h2 { font-size: 1.4rem; }
  header h1 { font-size: 1.05rem; }
  .invite-code { font-size: 0.85rem; padding: 0.3rem 0.6rem; word-break: break-all; }
}


/* TABS */
.tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(227, 215, 198, 0.9);
  margin-bottom: 1.5rem;
  gap: 0.5rem;
}
.tab {
  padding: 0.7rem 2rem;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text);
  transition: all 0.18s ease;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.tab.active {
  color: var(--primary-dark);
  font-weight: bold;
  border-color: var(--accent);
  background: rgba(197, 155, 85, 0.14);
  font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Liquid Glass Tabs */
.tabs.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(197, 155, 85, 0.4);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
  padding: 10px;
  z-index: 1000;
  border-radius: 24px;
  margin: 0 8px 8px;
  height: 72px;
}

.tabs.bottom-nav .tab {
  flex: 1;
  display: flex;
  /* flex-direction: column; */
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s ease;
}

.tabs.bottom-nav .tab span {
  display: none;
}

/* ====================== DESKTOP ====================== */
@media (min-width: 900px) {
  .tabs.bottom-nav {
    position: sticky;
    top: 0;
    margin: 0 auto;
    margin-top: -32px;
    margin-bottom: 32px;
    border-top: none;
    border-bottom: 1px solid rgba(197, 155, 85, 0.2);
    padding: 12px 20px;
    height: auto;
    box-shadow: 0 2px 12px rgba(197, 155, 85, 0.3);
    border-radius: 0px 0px 24px 24px;
  }

  #alert {
    position: fixed;
    top: 50px;
  }

  .tabs.bottom-nav .tab {
    flex-direction: row;
    gap: 8px;
    font-size: 0.96rem;
    padding: 8px 16px;
  }

  .tabs.bottom-nav .tab span {
    display: inline;
  }
}

/* Исправление перекрытий */
header {
  position: relative;
  z-index: 1010;
}

/* На мобильных — отступ снизу под bottom-nav + FAB */
@media (max-width: 899px) {
  main.container {
    padding-bottom: 110px !important;
  }
  
  .fab {
    bottom: 92px !important; /* выше bottom-nav */
  }
}