:root {
  --bg: #09111C;
  --gold: #C9A84C;
  --blue: #5783AD;
  --text: #EDEFF2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', system-ui, sans-serif;
  padding: 16px;
  padding-bottom: 80px;
}

h1 {
  font-family: 'ArsenalSC', 'Lato', sans-serif;
  color: var(--gold);
  font-size: 22px;
  margin: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}


#me {
  color: var(--blue);
  font-size: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bell {
  position: relative;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
}

.bell-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #d66;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
  line-height: 1.4;
}

.notifications-panel {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notifications-panel .empty {
  opacity: 0.6;
}

.field-label {
  font-size: 12px;
  color: var(--blue);
  margin-bottom: -4px;
}

.hypothesis-scores {
  display: flex;
  gap: 12px;
}

.hypothesis-scores > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hypothesis-scores input {
  width: 100%;
}

.hypothesis-label {
  font-size: 13px;
  color: var(--blue);
  opacity: 0.85;
  margin-bottom: 14px;
}

input, select, button {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

select {
  color-scheme: dark;
}

select option {
  background: #0F1D2E;
  color: var(--text);
}

select option:disabled {
  color: rgba(237,239,242,0.35);
}

button {
  background: var(--gold);
  color: #09111C;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

button:active { opacity: 0.8; }

/* Блик — только на основных золотых CTA-кнопках (класс проставляется явно) */
.btn-gold {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

@media (prefers-reduced-motion: no-preference) {
  .btn-gold::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-20deg);
    animation: btn-shine 4.5s ease-in-out infinite;
    pointer-events: none;
  }
}

@keyframes btn-shine {
  0% { left: -60%; }
  25% { left: 130%; }
  100% { left: 130%; }
}

.add-task {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.add-task input { flex: 1; min-width: 140px; }

.focus-hypothesis {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.focus-hypothesis-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 6px;
}

.focus-hypothesis-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.danger-btn {
  background: transparent;
  border: 1px solid rgba(214,102,102,0.5);
  color: #d66;
}

.empty-state {
  color: var(--blue);
  opacity: 0.85;
  font-size: 14px;
  line-height: 1.5;
}

.task-hypothesis-tag {
  font-size: 11px;
  color: var(--blue);
  opacity: 0.7;
  white-space: nowrap;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #0c1523;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  gap: 8px;
}

.nav-btn {
  flex: 1;
  background: transparent;
  color: var(--text);
  opacity: 0.6;
  border: none;
  font-weight: 600;
  padding: 10px;
  border-radius: 8px;
}

.nav-btn.active {
  opacity: 1;
  color: var(--gold);
  background: rgba(201,168,76,0.1);
}


.primary-btn {
  width: 100%;
  margin-bottom: 16px;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sort-row-label {
  font-size: 12px;
  color: var(--blue);
  white-space: nowrap;
  flex-shrink: 0;
}

.sort-row select {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 8px 10px;
}

.link-btn {
  background: transparent;
  color: var(--blue);
  border: none;
  padding: 6px 0;
  margin-bottom: 12px;
  font-weight: 600;
}

.hypothesis-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}

.hypothesis-card-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.hypothesis-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.hyp-chip {
  font-size: 11px;
  color: var(--blue);
  background: rgba(87,131,173,0.12);
  border: 1px solid rgba(87,131,173,0.25);
  border-radius: 999px;
  padding: 2px 8px;
}

.hypothesis-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--blue);
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-waiting { background: rgba(255,255,255,0.1); color: var(--text); }
.status-in_progress { background: rgba(201,168,76,0.2); color: var(--gold); }
.status-done { background: rgba(201,168,76,0.22); color: var(--gold); border: 1px solid rgba(201,168,76,0.4); }

.hyp-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  resize: vertical;
  width: 100%;
}

.hyp-form-row {
  display: flex;
  gap: 10px;
}

.hyp-form-row > * { flex: 1; }

.status-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-actions button {
  flex: 1;
  min-width: 120px;
}

.status-actions button.inactive {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.status-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.task-group {
  margin-bottom: 14px;
}

.task-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.task-group.own .task-group-header {
  color: var(--gold);
}

.task-group.other .task-group-header {
  color: var(--blue);
  font-weight: 600;
}

.task-group-arrow {
  transition: transform 0.15s;
  display: inline-block;
}

.task-group.collapsed .task-group-arrow {
  transform: rotate(-90deg);
}

.task-group.collapsed .task-list {
  display: none;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
}

.task.done .task-text-view {
  text-decoration: line-through;
  opacity: 0.5;
}

.task-text-box {
  flex: 1;
  min-width: 0;
}

.task-text-view {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  cursor: pointer;
  line-height: 1.35;
  padding: 2px 0;
}

.task-text-edit {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 2px 0;
  font-family: inherit;
  font-size: 15px;
}

.task-delete {
  background: transparent;
  color: #d66;
  font-weight: 700;
  padding: 4px 8px;
}

.task-drag-handle {
  background: transparent;
  border: none;
  color: var(--blue);
  opacity: 0.6;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.task.dragging {
  opacity: 0.92;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
  z-index: 500;
  position: fixed;
  pointer-events: none;
  margin: 0;
}

.task-placeholder {
  border: 1px dashed rgba(201,168,76,0.4);
  border-radius: 10px;
  background: rgba(201,168,76,0.06);
}

@media (prefers-reduced-motion: no-preference) {
  .task.just-completed {
    animation: task-complete-flash 0.6s ease;
  }
}

@keyframes task-complete-flash {
  0% { background: rgba(201,168,76,0.35); transform: scale(1.015); }
  100% { background: rgba(255,255,255,0.04); transform: scale(1); }
}

.bell.bump {
  animation: bell-bump 0.5s ease;
}

@keyframes bell-bump {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-14deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(4deg); }
}

.toast {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1000;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(12,21,35,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { color: #6fcf7c; border-color: rgba(111,207,124,0.4); }
.toast.error { color: #d66; border-color: rgba(214,102,102,0.4); }

.dev-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.admin-section-title {
  color: var(--gold);
  font-size: 15px;
  margin: 20px 0 10px;
}

.admin-invite-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 10px;
}

.admin-invite-link a {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  color: var(--blue);
}

.admin-invite-copy-btn {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 10px;
}

.admin-member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

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

.admin-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(201,168,76,0.15);
  padding: 2px 6px;
  border-radius: 999px;
}

.admin-remove-btn {
  background: transparent;
  border: 1px solid rgba(214,102,102,0.5);
  color: #d66;
  padding: 5px 10px;
  font-size: 12px;
}

.task-meta-counts {
  display: flex;
  gap: 8px;
  margin-top: 3px;
}

.task-meta-count {
  font-size: 11px;
  color: var(--blue);
  opacity: 0.85;
  white-space: nowrap;
}

.task-text-box {
  cursor: pointer;
}

.task-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.task-detail-panel {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.task-detail-section {
  margin-top: 18px;
}

.task-detail-section-title {
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.task-detail-info {
  font-size: 12px;
  color: var(--blue);
  margin-bottom: 4px;
}

.subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.subtask-row.done .subtask-text {
  text-decoration: line-through;
  opacity: 0.5;
}

.subtask-text {
  flex: 1;
  font-size: 14px;
}

.add-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.add-row input {
  min-width: 0;
}

.add-row input, .add-row textarea {
  flex: 1;
}

.comment-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 13px;
}

.comment-item-header {
  display: flex;
  justify-content: space-between;
  color: var(--blue);
  font-size: 11px;
  margin-bottom: 4px;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 13px;
}

.attachment-item a {
  color: var(--blue);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta {
  font-size: 11px;
  opacity: 0.6;
}

.file-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.file-upload-row input[type="file"] {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 12px;
  padding: 6px;
}

.file-upload-row button {
  flex-shrink: 0;
}
