:root {
  --ink: #060504;
  --cream: #f3ece2;
  --copper: #c8874a;
  --copper-light: #e8b87a;
  --glass: rgba(255, 248, 240, 0.05);
  --glass-border: rgba(255, 235, 210, 0.1);
  --muted: rgba(243, 236, 226, 0.5);
  --teal: #5ec4b6;
  --rose: #e8a0b4;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body.acc-body {
  font-family: 'DM Sans', 'Outfit', sans-serif;
  background: var(--ink);
  color: var(--cream);
  min-height: 100vh;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
.acc-bg { position: fixed; inset: 0; z-index: 0; }
.acc-bg-photo {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transform: scale(1.06); animation: accKen 24s ease-in-out infinite alternate;
}
@keyframes accKen { from { transform: scale(1.06); } to { transform: scale(1.12); } }
.acc-bg-shade {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(6,5,4,0.94) 0%, rgba(6,5,4,0.72) 50%, rgba(6,5,4,0.9) 100%);
}
.acc-shell { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 20px 16px 120px; }
.acc-shell.wide { max-width: 960px; }

.acc-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.acc-back {
  font-size: 0.9rem; font-weight: 600; color: var(--muted); text-decoration: none;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--glass-border);
  transition: color 0.2s, border-color 0.2s; min-height: 44px; display: inline-flex; align-items: center;
}
.acc-back:hover { color: var(--copper-light); border-color: rgba(200,135,74,0.35); }
.acc-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}
.acc-brand em { font-style: normal; color: var(--copper-light); }

.acc-hero { margin-bottom: 24px; }
.acc-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 6vw, 2.6rem); font-weight: 600; line-height: 1.1; margin-bottom: 10px;
}
.acc-hero h1 i { font-style: italic; color: var(--copper-light); }
.acc-hero p { font-size: 1rem; color: var(--muted); line-height: 1.55; }

.acc-portals { display: grid; gap: 14px; margin-bottom: 32px; }
.acc-portals.cols3 { grid-template-columns: repeat(3, 1fr); }
.acc-portal {
  display: block; text-decoration: none; color: var(--cream);
  padding: 26px 22px; border-radius: 18px; min-height: 120px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  position: relative; overflow: hidden;
}
.acc-portal:hover {
  transform: translateY(-4px);
  border-color: rgba(200,135,74,0.35);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.acc-portal.featured {
  border-color: rgba(200,135,74,0.3);
  background: linear-gradient(145deg, rgba(200,135,74,0.12), rgba(255,248,240,0.03));
}
.acc-portal-num { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; color: var(--copper); margin-bottom: 12px; }
.acc-portal-title { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 600; margin-bottom: 6px; }
.acc-portal-sub { font-size: 0.88rem; color: var(--muted); line-height: 1.4; }

.acc-panel {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 20px 18px; margin-bottom: 16px;
  backdrop-filter: blur(12px);
}
.acc-panel-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem; font-weight: 600; margin-bottom: 16px; color: rgba(243,236,226,0.85);
}
.acc-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.acc-field { flex: 1; min-width: 160px; }
.acc-field label {
  display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.acc-field input, .acc-field select, .acc-field textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.35);
  color: var(--cream); font-size: 16px; font-family: inherit; min-height: 48px;
}
.acc-field input:focus, .acc-field select:focus, .acc-field textarea:focus {
  outline: none; border-color: rgba(200,135,74,0.45);
}
.acc-field select option { background: #1a1510; color: var(--cream); }

.acc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 24px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 700; font-family: inherit; min-height: 52px;
  background: linear-gradient(135deg, var(--copper), #a06830); color: #fff;
  transition: transform 0.15s, opacity 0.15s; touch-action: manipulation;
}
.acc-btn:hover { transform: translateY(-1px); }
.acc-btn:active { transform: scale(0.98); }
.acc-btn.secondary {
  background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border); color: var(--cream);
}
.acc-btn.dark { background: rgba(0,0,0,0.45); border: 1px solid var(--glass-border); }
.acc-btn.warn { background: linear-gradient(135deg, #9a6b55, #c4876a); }
.acc-btn.danger { background: rgba(180, 60, 60, 0.35); border: 1px solid rgba(220, 100, 100, 0.45); color: #f5c4c4; }
.acc-btn.danger:hover { background: rgba(180, 60, 60, 0.5); }
.acc-btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.acc-btn-row .acc-btn { flex: 1; min-width: 140px; }

.acc-worker {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: 14px; margin-bottom: 10px;
  background: rgba(0,0,0,0.25); border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.acc-worker.on { background: rgba(200,135,74,0.1); border-color: rgba(200,135,74,0.35); }
.acc-worker input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--copper); cursor: pointer; flex-shrink: 0; }
.acc-worker .wn { flex: 1; min-width: 0; }
.acc-worker .wn b { display: block; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.acc-worker .wn small { font-size: 0.8rem; color: var(--muted); }
.acc-worker .amt input {
  width: 130px; padding: 12px 14px; border-radius: 10px; text-align: right;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.35);
  color: var(--cream); font-weight: 700; font-size: 16px; min-height: 48px;
}
.acc-worker .pay { font-weight: 800; font-size: 1rem; color: var(--copper-light); min-width: 100px; text-align: right; flex-shrink: 0; }
.acc-worker .friends { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); flex-shrink: 0; }
.acc-worker .friends input {
  width: 52px; padding: 10px; text-align: center; border-radius: 10px; font-size: 16px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.35); color: var(--cream); font-weight: 700; min-height: 44px;
}

/* Компактный список — дни рождения */
.acc-workers-compact .acc-worker { padding: 10px 12px; margin-bottom: 6px; gap: 8px; }
.acc-workers-compact .acc-worker .wn b { font-size: 0.88rem; }
.acc-workers-compact .acc-worker input[type=checkbox] { width: 20px; height: 20px; }
.acc-workers-compact .acc-worker .friends { font-size: 0.72rem; gap: 4px; }
.acc-workers-compact .acc-worker .friends input { width: 40px; padding: 6px; min-height: 34px; font-size: 14px; border-radius: 8px; }
.acc-workers-compact .acc-worker .pay { font-size: 0.82rem; min-width: 72px; }

/* Чуть компактнее — карта */
.acc-workers-card .acc-worker { padding: 11px 12px; margin-bottom: 7px; gap: 10px; }
.acc-workers-card .acc-worker .wn b { font-size: 0.92rem; }
.acc-workers-card .acc-worker .wn small { font-size: 0.72rem; }
.acc-workers-card .acc-worker input[type=checkbox] { width: 20px; height: 20px; }
.acc-workers-card .acc-worker .amt input { width: 110px; padding: 10px; min-height: 40px; font-size: 15px; }

.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.acc-stat {
  text-align: center; padding: 16px 12px; border-radius: 14px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
}
.acc-stat .n { font-family: 'Cormorant Garamond', serif; font-size: 1.75rem; font-weight: 700; color: var(--copper-light); }
.acc-stat .l { font-size: 0.78rem; color: var(--muted); margin-top: 6px; line-height: 1.3; }
.acc-stat.ok .n { color: var(--teal); }

/* Вкладки событий — «+ Новый» всегда видна справа */
.acc-tabs-wrap {
  display: flex; align-items: stretch; gap: 10px;
}
.acc-tabs-wrap > .acc-tab.add {
  flex-shrink: 0; align-self: center;
  white-space: nowrap;
}
.acc-tabs {
  display: flex; gap: 8px; flex: 1; min-width: 0;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 4px; margin-bottom: 0;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(200,135,74,0.4) transparent;
}
.acc-tabs::-webkit-scrollbar { height: 4px; }
.acc-tabs::-webkit-scrollbar-thumb { background: rgba(200,135,74,0.4); border-radius: 4px; }

.acc-tab {
  flex-shrink: 0; padding: 0; border-radius: 999px; font-size: 0.85rem; font-weight: 700;
  background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border); color: var(--muted);
  cursor: default; transition: background 0.2s, color 0.2s; min-height: 40px;
  display: inline-flex; align-items: center; touch-action: manipulation; white-space: nowrap;
  overflow: hidden;
}
.acc-tab .acc-tab-label {
  padding: 10px 4px 10px 16px; cursor: pointer;
}
.acc-tab .acc-tab-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin-right: 4px; border-radius: 50%;
  font-size: 1.2rem; line-height: 1; color: rgba(243,236,226,0.45); cursor: pointer;
  flex-shrink: 0; transition: background 0.15s, color 0.15s;
}
.acc-tab .acc-tab-x:hover { background: rgba(220, 80, 80, 0.35); color: #ffb4b4; }
.acc-tab.active { background: var(--copper); border-color: var(--copper); color: #fff; }
.acc-tab.active .acc-tab-x { color: rgba(255,255,255,0.7); }
.acc-tab.active .acc-tab-x:hover { background: rgba(0,0,0,0.25); color: #fff; }
.acc-tab.add { background: rgba(200,135,74,0.15); color: var(--copper-light); border-color: rgba(200,135,74,0.45); }

.acc-hist {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.95rem;
}
.acc-hist:last-child { border-bottom: none; }
.acc-hist .tag {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px; margin-right: 8px; white-space: nowrap;
}
.acc-hist .tag.advance { background: rgba(94,196,182,0.15); color: var(--teal); }
.acc-hist .tag.card { background: rgba(200,135,74,0.2); color: var(--copper-light); }
.acc-hist .tag.deduction { background: rgba(232,160,180,0.15); color: var(--rose); }
.acc-hist .sum { font-weight: 800; color: var(--rose); white-space: nowrap; font-size: 1rem; }
.acc-hist .sum.plus { color: var(--teal); }
.acc-empty { text-align: center; padding: 28px; color: var(--muted); font-size: 1rem; }

.acc-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(6,5,4,0.95); backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.acc-bar-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.acc-bar .acc-btn { min-width: 160px; flex-shrink: 0; }
.acc-bar .total b { color: var(--copper-light); font-size: 1.35rem; }
.acc-bar .total { font-size: 1rem; color: var(--muted); }

.acc-form-mode {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 700;
  background: rgba(94,196,182,0.12); color: var(--teal); margin-bottom: 14px;
}
.acc-form-mode.deduction { background: rgba(232,160,180,0.12); color: var(--rose); }

@media (max-width: 720px) {
  .acc-portals.cols3 { grid-template-columns: 1fr; }
  .acc-stats { grid-template-columns: 1fr; }
  .acc-row { flex-direction: column; }
  .acc-field { min-width: 100%; }
  .acc-field[style*="max-width"] { max-width: 100% !important; }
  .acc-btn-row { flex-direction: column; }
  .acc-btn-row .acc-btn { width: 100%; min-width: 0; }
  .acc-bar-inner { flex-direction: column; align-items: stretch; }
  .acc-bar .acc-btn { width: 100%; min-width: 0; }

  /* Дни рождения — одна строка, компактно */
  .acc-workers-compact .acc-worker {
    flex-wrap: nowrap; align-items: center;
    padding: 7px 8px; margin-bottom: 5px; gap: 6px;
  }
  .acc-workers-compact .acc-worker .wn { flex: 1; min-width: 0; order: unset; }
  .acc-workers-compact .acc-worker .wn b {
    font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .acc-workers-compact .acc-worker input[type=checkbox] { width: 17px; height: 17px; order: unset; }
  .acc-workers-compact .acc-worker .friends {
    order: unset; flex-shrink: 0; font-size: 0.65rem; gap: 3px; margin-top: 0;
  }
  .acc-workers-compact .acc-worker .friends input {
    width: 32px; padding: 4px 2px; min-height: 28px; font-size: 13px;
  }
  .acc-workers-compact .acc-worker .pay {
    order: unset; font-size: 0.75rem; min-width: 58px; width: auto;
    margin-top: 0; padding-top: 0; border-top: none;
  }

  /* Карта — компактнее на телефоне */
  .acc-workers-card .acc-worker {
    flex-wrap: nowrap; padding: 8px 10px; margin-bottom: 6px; gap: 8px;
  }
  .acc-workers-card .acc-worker .wn b { font-size: 0.82rem; }
  .acc-workers-card .acc-worker .wn small { font-size: 0.68rem; }
  .acc-workers-card .acc-worker input[type=checkbox] { width: 18px; height: 18px; }
  .acc-workers-card .acc-worker .amt input { width: 96px; padding: 8px; min-height: 36px; font-size: 14px; }

  /* Остальные страницы — стандартная раскладка */
  .acc-worker:not(.acc-workers-compact .acc-worker):not(.acc-workers-card .acc-worker) {
    flex-wrap: wrap; align-items: flex-start; padding: 14px;
  }

  .acc-hist { flex-direction: column; align-items: flex-start; gap: 8px; }
  .acc-hist > span:last-child { width: 100%; justify-content: space-between; display: flex; }
  .acc-top { flex-direction: column; align-items: stretch; }
  .acc-brand { text-align: center; }
  .acc-tab { font-size: 0.78rem; min-height: 36px; }
  .acc-tab .acc-tab-label { padding: 8px 2px 8px 12px; }
  .acc-tab .acc-tab-x { width: 28px; height: 28px; font-size: 1.1rem; margin-right: 2px; }
  .acc-tabs-wrap > .acc-tab.add { padding: 9px 14px; font-size: 0.82rem; }

  /* Вкладки событий — компактно на телефоне */
  .acc-tabs-wrap { gap: 6px; align-items: center; }
  .acc-tabs { gap: 5px; }
  .acc-tabs-wrap .acc-tab {
    font-size: 0.65rem; min-height: 26px; border-radius: 999px;
  }
  .acc-tabs-wrap .acc-tab .acc-tab-label { padding: 4px 0 4px 8px; }
  .acc-tabs-wrap .acc-tab .acc-tab-x {
    width: 20px; height: 20px; font-size: 0.85rem; margin-right: 3px;
  }
  .acc-tabs-wrap > .acc-tab.add {
    padding: 4px 10px; font-size: 0.65rem; min-height: 26px;
  }
}

@media (min-width: 721px) {
  .acc-shell { padding: 28px 24px 120px; }
  .acc-btn { padding: 16px 28px; font-size: 1.05rem; }
}
