*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #171F28;
  --navy-elevated: #243042;
  --red: #DC2626;
  --red-hover: #ef4444;
  --red-deep: #b91c1c;
  --white: #FFFFFF;

  --bg: #171F28;
  --bg-elevated: #243042;
  --surface: rgba(36, 48, 66, 0.92);
  --surface-solid: #243042;
  --surface-hover: #2c3a4f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.82);
  --text-muted: rgba(255, 255, 255, 0.52);
  --primary: #DC2626;
  --primary-hover: #ef4444;
  --primary-light: rgba(220, 38, 38, 0.16);
  --primary-glow: rgba(220, 38, 38, 0.35);
  --accent: #DC2626;
  --accent-2: #f87171;
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.14);
  --danger: #f87171;
  --danger-bg: rgba(220, 38, 38, 0.16);
  --agency: #fca5a5;
  --client: #93c5fd;
  --sidebar-bg: #121920;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-text: rgba(255, 255, 255, 0.55);
  --sidebar-text-active: #FFFFFF;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 12px 40px var(--primary-glow);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden; /* app shell fits viewport; scroll inside panels */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hidden { display: none !important; }

/* ─── Login ─── */
#login-view {
  min-height: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 70% 55% at 15% 10%, rgba(220, 38, 38, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 90%, rgba(36, 48, 66, 0.9), transparent 50%),
    linear-gradient(155deg, #121920 0%, #171F28 45%, #1a2433 100%);
}

#login-view::before,
#login-view::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

#login-view::before {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: rgba(220, 38, 38, 0.2);
}

#login-view::after {
  width: 360px;
  height: 360px;
  bottom: -100px;
  left: -60px;
  background: rgba(36, 48, 66, 0.8);
}

.login-card {
  position: relative;
  z-index: 1;
  background: rgba(36, 48, 66, 0.78);
  backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(220, 38, 38, 0.06);
}

.login-brand { text-align: center; margin-bottom: 36px; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  color: var(--white);
}

.logo.small { font-size: 1.05rem; }

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #DC2626 0%, #b91c1c 100%);
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

.logo-icon.sm { width: 36px; height: 36px; border-radius: 12px; }
.logo-icon.lg { width: 48px; height: 48px; }

.login-tagline {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: rgba(23, 31, 40, 0.55);
  border: 1px solid var(--border);
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.auth-tab.active {
  background: rgba(220, 38, 38, 0.18);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35);
}

.auth-tab:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.auth-hint {
  margin-top: 14px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

#login-form label,
#register-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

#login-form input,
#register-form input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 18px;
  background: rgba(23, 31, 40, 0.7);
  color: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

#login-form input::placeholder,
#register-form input::placeholder { color: rgba(255, 255, 255, 0.32); }

#login-form input:focus,
#register-form input:focus {
  outline: none;
  border-color: rgba(220, 38, 38, 0.7);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.error-text {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 10px;
}

.demo-accounts {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.demo-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 12px;
}

.demo-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(23, 31, 40, 0.55);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.86rem;
  margin-bottom: 8px;
  transition: all var(--transition);
}

.demo-btn:hover {
  border-color: rgba(220, 38, 38, 0.45);
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--white);
}

.demo-role {
  font-weight: 700;
  color: #fca5a5;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(145deg, #DC2626 0%, #b91c1c 100%);
  color: var(--white);
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.38);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.48);
  filter: brightness(1.06);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  border-color: var(--border);
}

.btn-sm { padding: 8px 14px; font-size: 0.82rem; border-radius: 9px; }
.btn-full { width: 100%; }
.upload-btn, .upload-html-btn { cursor: pointer; }

/* ─── Layout ─── */
#main-view {
  display: flex;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  width: 272px;
  height: 100%;
  max-height: 100%;
  background: linear-gradient(180deg, #1a2433 0%, var(--sidebar-bg) 100%);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  flex-shrink: 0;
  position: relative;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), padding 0.28s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.45), transparent 40%, transparent 60%, rgba(255, 255, 255, 0.08));
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px 22px;
}

.sidebar-header .logo {
  min-width: 0;
  flex: 1;
}

.sidebar-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--transition);
}

.sidebar-toggle:hover {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(220, 38, 38, 0.35);
  color: #fca5a5;
}

.sidebar-toggle-icon-expand { display: none; }

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 2px;
}

/* ─── Collapsed sidebar ─── */
.sidebar.collapsed {
  width: 84px;
  padding: 20px 12px;
}

.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 0 18px;
}

.sidebar.collapsed .sidebar-header .logo {
  flex: none;
  justify-content: center;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-meta {
  display: none;
}

.sidebar.collapsed .sidebar-toggle-icon-collapse { display: none; }
.sidebar.collapsed .sidebar-toggle-icon-expand { display: block; }

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px;
  gap: 0;
  margin-bottom: 8px;
}

.sidebar.collapsed .nav-item svg {
  opacity: 0.9;
  flex-shrink: 0;
}

.sidebar.collapsed .nav-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  margin-left: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.62rem;
}

.sidebar.collapsed .sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sidebar.collapsed .sidebar-footer .nav-item {
  width: 100%;
  margin-bottom: 4px;
}

.sidebar.collapsed .user-info {
  justify-content: center;
  padding: 8px;
  margin-bottom: 4px;
  width: 100%;
}

.sidebar.collapsed .sidebar-logout {
  width: 100%;
  justify-content: center;
  padding: 10px;
  min-height: 40px;
}

.sidebar.collapsed .logout-icon {
  display: block;
}

.logout-icon { display: none; }
.sidebar.collapsed .logout-icon { display: block; }

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 12px;
  margin-bottom: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
  font-family: inherit;
  transition: all var(--transition);
  position: relative;
}

.nav-item svg { opacity: 0.75; transition: opacity var(--transition); }

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text-active);
}

.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.22), rgba(220, 38, 38, 0.08));
  color: var(--sidebar-text-active);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.35);
}

.nav-item.active svg { opacity: 1; color: #fca5a5; }

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding-top: 12px;
  margin-top: auto;
  flex-shrink: 0;
  background: linear-gradient(180deg, transparent, rgba(18, 25, 32, 0.96) 28%);
  padding-bottom: 2px;
}

.sidebar-footer .nav-item {
  margin-bottom: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.user-meta { min-width: 0; }

.sidebar-logout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #DC2626, #991b1b);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

.user-name { font-weight: 700; font-size: 0.88rem; color: #f8fafc; }
.user-role { font-size: 0.75rem; color: var(--sidebar-text); }

#logout-btn {
  width: 100%;
  color: var(--sidebar-text);
  border-color: rgba(255, 255, 255, 0.06);
}

#logout-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 20px 24px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(220, 38, 38, 0.08), transparent 55%),
    radial-gradient(ellipse 45% 35% at 0% 100%, rgba(36, 48, 66, 0.55), transparent 50%),
    var(--bg);
}

.page { animation: pageIn 0.35s ease; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header { margin-bottom: 32px; }

.page-header.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
  color: var(--white);
  background: none;
  -webkit-text-fill-color: unset;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 620px;
}

.back-btn {
  background: rgba(36, 48, 66, 0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  transition: all var(--transition);
}

.back-btn:hover {
  color: var(--white);
  border-color: rgba(220, 38, 38, 0.4);
  background: var(--primary-light);
}

/* ─── Cards ─── */
.card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
}

/* ─── Projects ─── */
.project-grid,
.html-pages-grid {
  gap: 18px;
}

.project-card,
.html-page-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.project-card::before,
.html-page-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #DC2626, #f87171, transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover,
.html-page-card:hover {
  border-color: rgba(220, 38, 38, 0.35);
  box-shadow: var(--shadow), 0 0 0 1px rgba(220, 38, 38, 0.12);
  transform: translateY(-3px);
  background: var(--surface-hover);
}

.project-card:hover::before,
.html-page-card:hover::before { opacity: 1; }

.project-card.dragging {
  opacity: 0.5;
  transform: scale(0.98) rotate(1deg);
  box-shadow: var(--shadow-lg);
  cursor: grabbing;
}

.project-card.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.drag-handle {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--transition);
}

.drag-handle:hover {
  background: var(--primary-light);
  color: #fca5a5;
}

.drag-handle:active { cursor: grabbing; }

.project-card h3,
.html-page-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
  margin-bottom: 0;
  color: var(--white);
}

.project-card-meta,
.html-page-card-meta {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.project-card-footer,
.html-page-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-agency {
  background: var(--primary-light);
  color: #fca5a5;
}

.badge-client {
  background: rgba(147, 197, 253, 0.12);
  color: #93c5fd;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  background: rgba(36, 48, 66, 0.45);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.95rem;
  grid-column: 1 / -1;
}

/* ─── Project detail ─── */
.project-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.project-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-card-top .project-delete-btn {
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.project-card:hover .project-delete-btn,
.project-card:focus-within .project-delete-btn {
  opacity: 1;
}

.project-grid.view-list .project-delete-btn {
  opacity: 1;
}

/* ─── Trash ─── */
.trash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trash-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), background var(--transition);
}

.trash-item:hover {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.04);
}

.trash-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.12);
}

.trash-icon.project {
  color: #fcd34d;
  background: rgba(252, 211, 77, 0.12);
}

.trash-info {
  flex: 1;
  min-width: 0;
}

.trash-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trash-type-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.trash-meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.trash-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .trash-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .trash-actions {
    width: 100%;
  }
  .trash-actions .btn {
    flex: 1;
  }
}

.share-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(23, 31, 40, 0.55);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.share-label { color: var(--text-muted); white-space: nowrap; font-weight: 600; }

.share-link-box code {
  background: rgba(23, 31, 40, 0.8);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  color: #fca5a5;
}

.share-link-box.full code {
  max-width: 100%;
  word-break: break-all;
  white-space: normal;
  display: block;
}

.detail-layout { max-width: 100%; }

/* ─── Upload zones ─── */
.upload-zone {
  margin: 20px 24px;
  padding: 40px 28px;
  border: 2px dashed rgba(220, 38, 38, 0.28);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  transition: all var(--transition);
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.06), transparent);
}

.upload-zone svg { color: #f87171; opacity: 0.85; }

.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: #fecaca;
  transform: scale(1.01);
}

.upload-zone p { margin-top: 14px; font-size: 0.92rem; font-weight: 600; color: var(--text-secondary); }
.upload-hint { font-size: 0.82rem; opacity: 0.8; display: block; margin-top: 6px; }

.html-upload-zone { margin: 0 0 22px; }

/* ─── Files ─── */
.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.45);
}

.files-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.files-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.files-select-all input { accent-color: var(--primary); }

.files-count {
  font-size: 0.86rem;
  color: var(--text-secondary);
  font-weight: 700;
  white-space: nowrap;
}

.cloud-toolbar {
  margin: 0 0 18px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.55);
  color: var(--text-muted);
  max-width: 420px;
}

.cloud-search-field {
  max-width: 560px;
  width: 100%;
}

.search-kbd {
  display: none;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .cloud-search-field .search-kbd { display: inline-block; }
}

.global-file-results {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(36, 48, 66, 0.65);
}

.global-file-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.global-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background var(--transition);
}

.global-file-item:hover {
  background: rgba(220, 38, 38, 0.1);
}

.global-file-item .file-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.global-file-meta {
  min-width: 0;
  flex: 1;
}

.global-file-meta strong {
  display: block;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-file-meta span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.yc-google-sync-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
}

.yc-google-redirect {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.78);
  /* keep URI readable: break only at punctuation, not mid-word like "api" */
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
  cursor: pointer;
  user-select: all;
}


.yc-google-redirect:hover {
  color: #fff;
  background: rgba(220, 38, 38, 0.15);
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 0.92rem;
  outline: none;
}

.search-field input::placeholder { color: rgba(255, 255, 255, 0.35); }

.files-search-field {
  max-width: 260px;
  padding: 7px 12px;
  flex: 1;
}

.files-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 24px;
  background: rgba(220, 38, 38, 0.12);
  border-bottom: 1px solid rgba(220, 38, 38, 0.25);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fecaca;
}

.files-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-check {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
  cursor: pointer;
}

.file-check input { accent-color: var(--primary); width: 16px; height: 16px; }

.file-item.selected {
  background: rgba(220, 38, 38, 0.1);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.28);
}

.yc-cal-subscribers {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.yc-cal-subscribers-head {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.yc-cal-subscribers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.yc-subscriber-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.yc-subscriber-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  background: linear-gradient(145deg, #DC2626, #b91c1c);
  color: #fff;
  flex-shrink: 0;
}

.yc-subscriber-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.yc-subscriber-meta strong {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yc-subscriber-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yc-google-block { margin-top: 18px; }

.yc-google-status { margin-bottom: 8px; }

.yc-google-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yc-google-card strong { font-size: 0.88rem; }
.yc-google-card span { font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }
.yc-google-card.connected {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.yc-google-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sort-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}

.sort-btn,
.sort-dir-btn {
  border: 1px solid var(--border);
  background: rgba(36, 48, 66, 0.9);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.sort-btn:hover,
.sort-dir-btn:hover {
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}

.sort-btn.active {
  background: var(--primary-light);
  border-color: rgba(220, 38, 38, 0.45);
  color: #fecaca;
}

.sort-dir-btn {
  width: 34px;
  padding: 6px 0;
  font-size: 1rem;
}

.file-ext {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--primary-light);
  color: #fca5a5;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-right: 6px;
  letter-spacing: 0.04em;
}

.file-share-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--success-bg);
  color: #6ee7b7;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}
.file-share-badge:hover {
  border-color: rgba(110, 231, 183, 0.5);
  filter: brightness(1.1);
}

.meta-share-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(110, 231, 183, 0.35);
  background: var(--success-bg);
  color: #6ee7b7;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.meta-share-chip:hover { filter: brightness(1.08); }

/* Copy folder link — matches site red/navy palette */
.project-copy-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(220, 38, 38, 0.38);
  background:
    linear-gradient(145deg, rgba(220, 38, 38, 0.22) 0%, rgba(220, 38, 38, 0.10) 100%);
  color: #fecaca;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 6px 16px rgba(0, 0, 0, 0.22);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}
.project-copy-link-btn:hover {
  transform: translateY(-1px);
  color: #ffffff;
  border-color: rgba(220, 38, 38, 0.65);
  background: linear-gradient(145deg, #DC2626 0%, #b91c1c 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 10px 24px rgba(220, 38, 38, 0.38);
}
.project-copy-link-btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 4px 12px rgba(220, 38, 38, 0.28);
}
.project-copy-link-btn:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.85);
  outline-offset: 2px;
}
.project-copy-link-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.project-grid.view-list .project-copy-link-btn {
  font-size: 0.8rem;
  padding: 9px 14px;
  border-radius: 11px;
}
@media (max-width: 700px) {
  .project-copy-link-btn {
    white-space: normal;
    text-align: left;
    max-width: 100%;
  }
}

.project-no-share {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.share-link-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}
.share-link-row .share-link-box {
  flex: 1;
  min-width: 180px;
  cursor: pointer;
}
.share-link-row .share-link-box:hover {
  border-color: rgba(220, 38, 38, 0.45);
}
.share-link-row #share-modal-copy {
  flex-shrink: 0;
  white-space: nowrap;
}
.share-existing-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #6ee7b7;
  margin-bottom: 8px;
}
.share-copy-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.icon-btn.copy-link-btn.share-active {
  color: #6ee7b7;
  background: var(--success-bg);
}

.icon-btn.share-active {
  color: #6ee7b7;
  background: var(--success-bg);
}

.files-list.view-list,
.files-list:not(.view-grid):not(.view-list) { padding: 8px 12px 16px; }

.file-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.file-item-main {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: transparent;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease;
  will-change: transform;
}

.file-item:hover {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.15);
}

.file-version-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, 0.4);
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  vertical-align: middle;
}
.file-version-badge:hover { filter: brightness(1.15); }

.file-versions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
  margin: 8px 0 12px;
}
.file-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  flex-wrap: wrap;
}
.file-version-row.is-current {
  border-color: rgba(110, 231, 183, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.file-version-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.file-version-main span {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.file-version-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.file-swipe-actions {
  display: none;
}

.mobile-copy-link {
  display: none;
}
.desktop-only-icon {
  display: inline-flex;
}

.file-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(36, 48, 66, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.file-info { flex: 1; min-width: 0; }

.file-name {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--white);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.file-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.files-list.view-list .file-name,
.files-list:not(.view-grid) .file-name {
  /* keep one line when possible in list mode */
  display: flex;
  flex-wrap: wrap;
}

.files-list.view-list .file-item-main,
.files-list:not(.view-grid):not(.view-list) .file-item-main {
  min-width: 0;
}

.files-list.view-list .file-info {
  min-width: 0;
  overflow: hidden;
}

.file-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.55);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.icon-btn:hover {
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
  background: var(--primary-light);
  transform: translateY(-1px);
}

.icon-btn.danger:hover {
  background: var(--danger-bg);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--danger);
}

/* ─── Modals ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--navy-elevated);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  margin: auto; /* centers in scrollable overlay when content is short */
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(220, 38, 38, 0.08);
  border: 1px solid var(--border-strong);
  animation: modalIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--white);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
}

.modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

#new-project-form { padding: 26px; }

#new-project-form label,
.share-modal-body label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

#new-project-form input,
#new-project-form select,
#new-project-form textarea,
.share-modal-body select,
.share-modal-body input[type="datetime-local"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  margin-bottom: 18px;
  background: rgba(23, 31, 40, 0.75);
  color: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

#new-project-form option,
.share-modal-body option {
  background: #243042;
  color: #fff;
}

#new-project-form input:focus,
#new-project-form select:focus,
#new-project-form textarea:focus,
.share-modal-body select:focus,
.share-modal-body input:focus {
  outline: none;
  border-color: rgba(220, 38, 38, 0.65);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.share-modal-body { padding: 26px; }

.share-modal-desc {
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.share-result { margin-bottom: 8px; }

.share-expiry-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(36, 48, 66, 0.9);
  border: 1px solid var(--border);
}

.view-toggle-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.view-toggle-btn:hover {
  color: #fca5a5;
  background: var(--primary-light);
}

.view-toggle-btn.active {
  background: rgba(23, 31, 40, 0.9);
  color: #fecaca;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.files-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Grid view (default) */
.project-grid.view-grid,
.html-pages-grid.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* List view */
.project-grid.view-list,
.html-pages-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-grid.view-list .project-card,
.html-pages-grid.view-list .html-page-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 16px 20px;
}

.project-grid.view-list .drag-handle {
  display: none;
}

.project-grid.view-list .project-card-top {
  flex: 1 1 220px;
  margin-bottom: 0;
  min-width: 0;
}

.project-grid.view-list .project-card-meta {
  flex: 2 1 280px;
  margin-bottom: 0;
  min-width: 0;
}

.project-grid.view-list .project-card-footer,
.html-pages-grid.view-list .html-page-card-footer {
  flex: 0 0 auto;
  margin-left: auto;
  border-top: none;
  padding-top: 0;
  gap: 16px;
}

.html-pages-grid.view-list .html-page-card h3 {
  flex: 1 1 200px;
  margin-bottom: 0;
  min-width: 0;
}

.html-pages-grid.view-list .html-page-card-meta {
  flex: 2 1 300px;
  margin-bottom: 0;
  min-width: 0;
}

.files-list.view-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 16px;
}

.files-list.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
}

.files-list.view-grid .file-item {
  border: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.35);
  margin-bottom: 0;
  min-width: 0;
}

.files-list.view-grid .file-item:hover {
  background: var(--surface-hover);
  border-color: rgba(220, 38, 38, 0.3);
  box-shadow: var(--shadow-sm);
}

/* Card layout: stack icon → name → actions (was row, so names collapsed to 1 letter width) */
.files-list.view-grid .file-item-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 20px 14px 16px;
  min-width: 0;
}

.files-list.view-grid .file-check {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.files-list.view-grid .file-icon {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
  margin: 4px 0 0;
}

.files-list.view-grid .file-info {
  width: 100%;
  min-width: 0;
  flex: none;
}

.files-list.view-grid .file-name {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  text-align: center;
}

.files-list.view-grid .file-name .file-version-badge,
.files-list.view-grid .file-name .file-share-badge,
.files-list.view-grid .file-name .meta-share-chip {
  display: inline-flex;
  margin: 4px 2px 0;
  vertical-align: middle;
}

.files-list.view-grid .file-meta {
  margin-top: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}

.files-list.view-grid .file-actions {
  margin-top: 4px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  gap: 6px;
}

.files-list.view-grid .file-swipe-actions {
  display: none !important;
}

/* ─── HTML Editor ─── */
.html-editor-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.html-editor-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.html-title-input {
  flex: 1;
  min-width: 200px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 4px 0;
  font-family: inherit;
  color: var(--white);
  background: transparent;
}

.html-title-input:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

.html-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.html-editor-actions .btn.active {
  background: var(--primary-light);
  color: #fecaca;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.html-editor-layout {
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 300px);
}

.html-editor-layout.split { grid-template-columns: 1fr 1fr; }
.html-editor-layout.code-only .html-preview-pane { display: none; }
.html-editor-layout.code-only { grid-template-columns: 1fr; }
.html-editor-layout.preview-only .html-code-pane { display: none; }
.html-editor-layout.preview-only { grid-template-columns: 1fr; }

.html-code-pane,
.html-preview-pane {
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.pane-label {
  padding: 12px 16px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.55);
}

.pane-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-right: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.55);
}

.pane-label-row .pane-label {
  border-bottom: none;
  background: transparent;
  flex: 1;
}

.pane-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.pane-copy-btn:hover {
  color: #fff;
  background: rgba(220, 38, 38, 0.14);
}

/* ─── Copy bubble «облачко» ─── */
.copy-bubble {
  position: absolute;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  background: linear-gradient(145deg, #243042 0%, #171F28 100%);
  border: 1px solid rgba(52, 211, 153, 0.45);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(52, 211, 153, 0.18);
  opacity: 0;
  transform: translateY(6px) scale(0.92);
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.copy-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.copy-bubble.hiding {
  opacity: 0;
  transform: translateY(-4px) scale(0.96);
}

.copy-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: #171F28;
  border-right: 1px solid rgba(52, 211, 153, 0.45);
  border-bottom: 1px solid rgba(52, 211, 153, 0.45);
  transform: rotate(45deg);
}

.copy-bubble-below::after {
  bottom: auto;
  top: -6px;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(52, 211, 153, 0.45);
  border-top: 1px solid rgba(52, 211, 153, 0.45);
}

.copy-bubble-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
  flex-shrink: 0;
}

.html-code-editor {
  flex: 1;
  width: 100%;
  min-height: 480px;
  border: none;
  padding: 18px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  resize: vertical;
  background: #0f141b;
  color: #e2e8f0;
}

.html-code-editor:focus { outline: none; }

.html-preview-frame {
  flex: 1;
  width: 100%;
  min-height: 480px;
  border: none;
  background: #fff;
}

.danger-text { color: var(--danger) !important; }
.danger-text:hover { background: var(--danger-bg) !important; }

.btn-danger {
  background: linear-gradient(145deg, #ef4444, #b91c1c);
  color: #fff;
  border: none;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.4);
}

.btn-danger:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.5);
}

.btn-danger:active {
  transform: translateY(0);
}

/* ─── Confirm modal ─── */
.confirm-overlay {
  z-index: 160;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(8, 12, 18, 0.72);
  animation: confirmOverlayIn 0.22s ease;
}

.confirm-overlay.closing {
  animation: confirmOverlayOut 0.18s ease forwards;
}

@keyframes confirmOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes confirmOverlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.confirm-modal {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  padding: 32px 28px 24px;
  border-radius: 22px;
  background:
    linear-gradient(165deg, rgba(48, 62, 82, 0.98) 0%, rgba(30, 40, 54, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(220, 38, 38, 0.12);
  text-align: center;
  overflow: hidden;
  animation: confirmModalIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.confirm-overlay.closing .confirm-modal {
  animation: confirmModalOut 0.18s ease forwards;
}

@keyframes confirmModalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes confirmModalOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

.confirm-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 140px;
  background: radial-gradient(ellipse, rgba(220, 38, 38, 0.45), transparent 70%);
  pointer-events: none;
  filter: blur(4px);
}

.confirm-modal.tone-warning .confirm-glow {
  background: radial-gradient(ellipse, rgba(251, 191, 36, 0.4), transparent 70%);
}

.confirm-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.confirm-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fecaca;
  background:
    linear-gradient(145deg, rgba(239, 68, 68, 0.28), rgba(185, 28, 28, 0.12));
  border: 1px solid rgba(248, 113, 113, 0.35);
  box-shadow:
    0 12px 28px rgba(220, 38, 38, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: confirmIconPop 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.confirm-modal.tone-warning .confirm-icon {
  color: #fde68a;
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.28), rgba(180, 83, 9, 0.12));
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow:
    0 12px 28px rgba(245, 158, 11, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

@keyframes confirmIconPop {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.confirm-title {
  position: relative;
  z-index: 1;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.3;
}

.confirm-message {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 26px;
  white-space: pre-line;
}

.confirm-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-actions .btn {
  min-width: 120px;
  padding: 12px 18px;
  font-weight: 700;
  border-radius: 12px;
}

.confirm-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

.confirm-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: linear-gradient(135deg, #243042, #171F28);
  color: white;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  border: 1px solid rgba(220, 38, 38, 0.35);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(420px, calc(100vw - 32px));
}

.toast-action {
  border: none;
  background: rgba(220, 38, 38, 0.25);
  color: #fecaca;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.toast-action:hover { background: rgba(220, 38, 38, 0.45); color: #fff; }

@keyframes toastIn {
  from { transform: translateY(16px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Loading overlay */
.page-loading {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(23, 31, 40, 0.45);
  backdrop-filter: blur(4px);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  pointer-events: all;
}
.page-loading.hidden { display: none; }
.page-loading-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #DC2626;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Upload progress */
.upload-progress {
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.25);
}
.upload-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fecaca;
}
.upload-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #DC2626, #f87171);
  transition: width 0.15s ease;
}

/* File preview */
.file-preview-dialog {
  max-width: min(960px, 96vw);
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.file-preview-body {
  flex: 1;
  min-height: 280px;
  max-height: 70vh;
  overflow: auto;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 8px;
}
.file-preview-img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}
.file-preview-frame {
  width: 100%;
  height: 68vh;
  border: none;
  background: #fff;
}

/* Profile */
.profile-modal-body label { display: block; margin: 10px 0 6px; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.profile-modal-body input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(23, 31, 40, 0.55);
  color: #fff;
  margin-bottom: 4px;
}
.profile-line { margin: 0 0 4px; }
.profile-line.muted { color: var(--text-muted); font-size: 0.9rem; }
.profile-sep { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.profile-sub { font-size: 0.95rem; margin: 0 0 8px; }
.user-info { cursor: pointer; border-radius: 12px; transition: background var(--transition); }
.user-info:hover { background: rgba(255, 255, 255, 0.06); }

/* Calendar drag */
.yc-timed-event.is-draggable,
.yc-event.is-draggable { cursor: grab; }
.yc-timed-event.is-dragging,
.yc-event.is-dragging { opacity: 0.45; cursor: grabbing; }
.yc-drop-hover {
  outline: 2px dashed rgba(220, 38, 38, 0.55) !important;
  background: rgba(220, 38, 38, 0.08) !important;
}

/* Mobile bottom nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(23, 31, 40, 0.96);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
  gap: 4px;
  backdrop-filter: blur(12px);
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
}
.mobile-nav-item.active {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.12);
}
.mobile-more-sheet {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 95;
  background: #243042;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-more-sheet.hidden { display: none; }
.mobile-more-item {
  border: none;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.mobile-more-item:hover { background: rgba(255, 255, 255, 0.06); }

/* Notifications */
.notif-bell-btn { position: relative; }
.notif-badge { margin-left: auto; }
.notif-panel {
  position: fixed;
  right: 16px;
  bottom: 80px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(480px, 70vh);
  z-index: 160;
  background: #243042;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-panel.hidden { display: none; }
.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.notif-list { overflow: auto; flex: 1; padding: 8px; }
.notif-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,0.06); }
.notif-item.unread { background: rgba(220,38,38,0.1); }
.notif-item strong { font-size: 0.9rem; }
.notif-item span { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.35; }
.notif-item time { font-size: 0.72rem; color: var(--text-muted); }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }

/* Recent folders */
.recent-folders { margin: 0 0 16px; }
.recent-folders-head {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.recent-folders-row { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(36,48,66,0.8);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}
.recent-folder-chip:hover { border-color: rgba(220,38,38,0.45); background: rgba(220,38,38,0.1); }
.recent-folder-meta { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

.files-filter-row {
  padding: 8px 24px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.files-filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.files-filter-label select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(23,31,40,0.7);
  color: #fff;
}

.yc-cal-sub-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(220,38,38,0.25);
  color: #fecaca;
  margin-left: 6px;
}

.onboarding-dialog { max-width: 440px; }
.onboarding-body p { line-height: 1.5; color: var(--text-secondary); margin: 0 0 10px; }
.onboarding-step-n { font-size: 0.8rem; color: var(--text-muted) !important; }

#move-files-project {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(23,31,40,0.55);
  color: #fff;
  margin-bottom: 12px;
}

@media (max-width: 860px) {
  body { overflow: auto; height: auto; min-height: 100%; }
  #main-view { height: auto; min-height: 100dvh; max-height: none; overflow: visible; }
  .sidebar { height: auto; max-height: none; overflow: visible; }
  .sidebar-nav { overflow: visible; }
  .content { height: auto; max-height: none; overflow: visible; }
  #main-view .content:has(#page-calendar:not(.hidden)) {
    overflow: visible;
    height: auto;
  }
  .page#page-calendar, #page-calendar.page {
    height: auto;
    min-height: 70vh;
    overflow: visible;
  }
  .mobile-bottom-nav { display: flex; }
  #main-view .content {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
    right: 12px;
    left: 12px;
  }
  .project-detail-actions {
    flex-wrap: wrap;
  }
  .project-detail-actions .btn {
    min-height: 40px;
    font-size: 0.88rem;
  }
  #copy-project-link-btn {
    order: -1;
    width: 100%;
    font-size: 0.95rem;
    padding: 12px 16px;
  }
  .mobile-copy-link {
    display: inline-flex !important;
    min-height: 36px;
    padding: 6px 12px;
    font-weight: 800;
  }
  .desktop-only-icon {
    display: none !important;
  }
  .file-item {
    overflow: hidden;
  }
  .file-swipe-actions {
    display: flex;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 168px;
    z-index: 0;
  }
  .file-swipe-btn {
    flex: 1;
    border: none;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    padding: 0 4px;
  }
  .file-swipe-btn.copy,
  .file-swipe-btn.share { background: #059669; }
  .file-swipe-btn.dl { background: #2563eb; }
  .file-swipe-btn.del { background: #dc2626; }
  .file-actions .icon-btn.share-file-btn,
  .file-actions .icon-btn.download-btn,
  .file-actions .icon-btn.danger.delete-btn {
    /* keep a couple; swipe covers rest on mobile */
  }
  .yc-view-switch {
    max-width: 100%;
    overflow-x: auto;
  }
  .yc-sidebar {
    max-height: none;
  }
  .yc-create-btns .btn {
    min-height: 44px;
  }
  .files-list.view-grid .file-item-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}


/* ─── Ads ROI calculator ─── */
.ads-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ads-mode-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(23, 31, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 28px rgba(0, 0, 0, 0.28);
  min-width: min(420px, 100%);
}

.ads-mode-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ads-mode-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.ads-mode-btn.active {
  color: #fff;
  background: linear-gradient(145deg, #DC2626 0%, #b91c1c 100%);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
}

.ads-mode-btn-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ads-mode-btn-sub {
  font-size: 0.74rem;
  font-weight: 600;
  opacity: 0.78;
}

.ads-mode-btn.active .ads-mode-btn-sub {
  opacity: 0.92;
}

.ads-field-primary .ads-input-wrap.primary {
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  background: rgba(220, 38, 38, 0.06);
}

.ads-margin-range-block {
  margin: 0 0 14px;
}

.ads-calc-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}

.ads-calc-card,
.ads-calc-results .card-like,
.ads-status-card,
.ads-metric {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.ads-calc-inputs {
  padding: 22px 22px 18px;
}

.ads-calc-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.ads-calc-card-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.ads-field {
  margin-bottom: 14px;
}

.ads-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 6px;
}

.ads-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ads-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(23, 31, 40, 0.65);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.ads-input-wrap:focus-within {
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.ads-input-wrap input[type="number"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 14px;
  outline: none;
}

.ads-input-wrap input[type="number"]::-webkit-outer-spin-button,
.ads-input-wrap input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ads-input-wrap input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.ads-suffix {
  padding: 0 14px 0 0;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.ads-hint {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.35;
}

.ads-range-wrap {
  margin-top: 8px;
}

.ads-range-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.ads-formula-box {
  margin-top: 8px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(23, 31, 40, 0.55);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.ads-formula-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ads-formula-box ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.8rem;
  line-height: 1.55;
}

.ads-calc-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ads-status-card {
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}

.ads-status-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 100% 0%, rgba(220, 38, 38, 0.18), transparent 55%);
  pointer-events: none;
}

.ads-status-card.is-profit::before {
  background: radial-gradient(ellipse 70% 80% at 100% 0%, rgba(52, 211, 153, 0.22), transparent 55%);
}

.ads-status-card.is-loss::before {
  background: radial-gradient(ellipse 70% 80% at 100% 0%, rgba(248, 113, 113, 0.22), transparent 55%);
}

.ads-status-label {
  position: relative;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.ads-status-value {
  position: relative;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.ads-status-card.is-profit .ads-status-value { color: #6ee7b7; }
.ads-status-card.is-loss .ads-status-value { color: #fca5a5; }

.ads-status-sub {
  position: relative;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
}

.ads-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ads-metric {
  padding: 14px 16px;
}

.ads-metric.highlight {
  border-color: rgba(220, 38, 38, 0.25);
  background: linear-gradient(145deg, rgba(220, 38, 38, 0.1), rgba(36, 48, 66, 0.95));
}

.ads-metric.big {
  grid-column: span 1;
  border-color: rgba(255, 255, 255, 0.12);
}

.ads-metric-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.3;
}

.ads-metric-value {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.ads-metric-value.sm { font-size: 1.05rem; }
.ads-metric-value.pos { color: #6ee7b7; }
.ads-metric-value.neg { color: #f87171; }

.ads-break-even,
.ads-funnel {
  padding: 18px 18px 16px;
}

.ads-break-even h3,
.ads-funnel h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.ads-be-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.ads-funnel-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ads-funnel-row {
  display: grid;
  grid-template-columns: 64px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
}

.ads-funnel-row span { color: var(--text-muted); font-weight: 600; }
.ads-funnel-row b { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

.ads-funnel-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ads-funnel-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #b91c1c, #ef4444);
  transition: width 0.35s ease;
}

#ads-funnel-clk { background: linear-gradient(90deg, #c2410c, #fb923c); }
#ads-funnel-conv { background: linear-gradient(90deg, #047857, #34d399); }

@media (max-width: 960px) {
  .ads-calc-layout {
    grid-template-columns: 1fr;
  }
  .ads-field-row,
  .ads-be-grid,
  .ads-metrics-grid {
    grid-template-columns: 1fr;
  }
  .ads-metric.big { grid-column: auto; }
}

/* ─── Yandex-style Calendar ─── */
.page#page-calendar,
#page-calendar.page {
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* page itself doesn't scroll — board/sidebar do */
  overflow: hidden;
}

/* calendar fills content area without forcing page scroll */
#main-view .content:has(#page-calendar:not(.hidden)) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 10px;
}
#main-view .content:has(#page-calendar:not(.hidden)) #page-calendar {
  flex: 1 1 auto;
  min-height: 0;
}

.yc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.yc-sidebar {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-sm);
}

.yc-create-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yc-inbox-open-btn {
  position: relative !important;
  display: flex !important;
  align-items: center;
  justify-content: center !important;
  gap: 10px;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.16), rgba(23, 31, 40, 0.5)) !important;
  color: #fff !important;
}

.yc-inbox-open-btn:hover {
  border-color: rgba(129, 140, 248, 0.55) !important;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.28), rgba(36, 48, 66, 0.7)) !important;
}

.yc-inbox-btn-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  width: 100%;
  text-align: center;
}

.yc-inbox-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #6366f1;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.yc-inbox-badge.hidden {
  display: none !important;
}

.yc-new-task-btn {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

.yc-new-task-btn:hover {
  border-color: rgba(249, 115, 22, 0.5) !important;
  background: rgba(249, 115, 22, 0.12) !important;
  color: #fff !important;
}

/* Inbox sheet */
.yc-inbox-sheet {
  width: min(520px, calc(100vw - 28px));
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(45, 52, 78, 0.99) 0%, rgba(22, 28, 42, 0.99) 100%);
  border: 1px solid rgba(129, 140, 248, 0.25);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(99, 102, 241, 0.14);
  overflow: hidden;
  animation: confirmModalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.yc-inbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  background: radial-gradient(ellipse 80% 80% at 0% 0%, rgba(99, 102, 241, 0.18), transparent 55%);
}

.yc-inbox-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 4px;
}

.yc-inbox-head h2 {
  margin: 0 36px 6px 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.yc-inbox-sub {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
  max-width: 36ch;
}

.yc-inbox-compose {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.yc-inbox-compose input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(23, 31, 40, 0.75);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
}

.yc-inbox-compose input:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.yc-inbox-list {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.yc-inbox-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}

.yc-inbox-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.yc-inbox-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(23, 31, 40, 0.55);
  border-left: 4px solid #818cf8;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.yc-inbox-item:hover {
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(99, 102, 241, 0.08);
}

.yc-inbox-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.yc-inbox-item-main strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.yc-inbox-item-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

.yc-inbox-item-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
}

.yc-inbox-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.yc-inbox-item-del {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.yc-inbox-item-del:hover {
  background: rgba(220, 38, 38, 0.16);
  color: #f87171;
}

.yc-inbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.yc-inbox-foot-hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
}

.yc-task {
  border: none;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--yc-color, #f97316);
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.yc-task-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
  background: transparent;
}

.yc-task.is-done {
  opacity: 0.65;
  text-decoration: line-through;
}

.yc-task.is-done .yc-task-box {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.yc-task.color-blue { --yc-color: #3b82f6; background: #3b82f6; }
.yc-task.color-red { --yc-color: #ef4444; background: #ef4444; }
.yc-task.color-green { --yc-color: #22c55e; background: #22c55e; }
.yc-task.color-orange { --yc-color: #f97316; background: #f97316; }
.yc-task.color-purple { --yc-color: #a855f7; background: #a855f7; }
.yc-task.color-pink { --yc-color: #ec4899; background: #ec4899; }
.yc-task.color-teal { --yc-color: #14b8a6; background: #14b8a6; }
.yc-task.color-yellow { --yc-color: #ca8a04; background: #ca8a04; }

.yc-agenda-task.is-done strong {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Large stylish "Выполнено" toggle */
.yc-done-toggle {
  display: flex !important;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(23, 31, 40, 0.55);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.yc-done-toggle:hover {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.yc-done-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.yc-done-box {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.yc-done-check {
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.18s ease;
}

.yc-done-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.yc-done-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.2;
}

.yc-done-hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.42);
}

.yc-done-input:focus-visible + .yc-done-box {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
  border-color: #4ade80;
}

.yc-done-input:checked + .yc-done-box {
  background: linear-gradient(145deg, #22c55e, #16a34a);
  border-color: #4ade80;
  color: #fff;
  box-shadow:
    0 8px 18px rgba(34, 197, 94, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.yc-done-input:checked + .yc-done-box .yc-done-check {
  opacity: 1;
  transform: scale(1);
}

.yc-done-input:checked ~ .yc-done-text .yc-done-title {
  color: #86efac;
}

.yc-done-input:checked ~ .yc-done-text .yc-done-hint {
  color: rgba(134, 239, 172, 0.65);
}

.yc-done-toggle:has(.yc-done-input:checked) {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.14), rgba(23, 31, 40, 0.55));
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12);
}

.yc-done-toggle.compact {
  margin-top: 8px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.yc-done-toggle.compact .yc-done-box {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.yc-done-toggle.compact .yc-done-title {
  font-size: 0.98rem;
}

.yc-task-card.is-done .yc-card-title {
  text-decoration: line-through;
  opacity: 0.75;
}

.yc-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.yc-mini-weekdays,
.yc-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.yc-mini-weekdays span {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}

.yc-mini-cell {
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.yc-mini-cell.empty { visibility: hidden; }
.yc-mini-cell.weekend { color: rgba(255, 255, 255, 0.4); }
.yc-mini-cell.holiday { color: #fca5a5; background: rgba(239, 68, 68, 0.12); }
.yc-mini-cell.is-today { box-shadow: inset 0 0 0 2px #60a5fa; }
.yc-mini-cell.is-selected { background: rgba(220, 38, 38, 0.35); color: #fff; }
.yc-mini-cell:hover { background: rgba(255, 255, 255, 0.08); }

.yc-cals-block { flex: 1; }
.yc-cals-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.yc-cal-list { display: flex; flex-direction: column; gap: 4px; }

.yc-subs-block { margin-top: 18px; }

.yc-sub-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 8px 8px;
  line-height: 1.4;
}

.yc-cal-item.is-sub .yc-cal-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.yc-cal-owner {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yc-cal-share-field {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.yc-cal-share-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.yc-cal-share-hint,
.yc-subscribe-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0 0 12px;
}

.yc-cal-share-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.yc-cal-share-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(23, 31, 40, 0.55);
  color: var(--white);
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
}

.yc-cal-share-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.yc-subscribe-preview {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.yc-subscribe-preview strong {
  display: block;
  margin-bottom: 4px;
}

.yc-subscribe-preview span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

#yc-subscribe-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

#yc-subscribe-form input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 10px;
  background: rgba(23, 31, 40, 0.55);
  color: var(--white);
}

#yc-subscribe-form input[type="text"]:focus {
  outline: none;
  border-color: rgba(220, 38, 38, 0.7);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.yc-readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.yc-cal-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 8px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.yc-cal-item:hover { background: rgba(255, 255, 255, 0.05); }

.yc-cal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 4px 0;
}

.yc-cal-item input { accent-color: var(--primary); flex-shrink: 0; }

.yc-cal-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yc-cal-more {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.65;
  transition: all var(--transition);
}

.yc-cal-item:hover .yc-cal-more,
.yc-cal-more:hover,
.yc-cal-more:focus {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.yc-add-cal-btn {
  margin-top: 8px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.yc-add-cal-btn:hover {
  border-color: rgba(220, 38, 38, 0.45);
  color: #fff;
  background: rgba(220, 38, 38, 0.1);
}

.yc-add-cal-plus {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

/* Calendar settings modal */
.yc-cal-settings-dialog {
  max-width: 440px;
  width: min(440px, calc(100vw - 32px));
}

.yc-cal-settings-form {
  padding-top: 4px;
}

.yc-cal-name-field {
  margin-bottom: 22px;
}

.yc-cal-name-field label {
  display: block;
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.yc-cal-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(145deg, rgba(36, 48, 66, 0.95), rgba(23, 31, 40, 0.9));
  color: #fff;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.yc-cal-name-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
  font-weight: 700;
}

.yc-cal-name-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.yc-cal-name-input:focus {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 4px rgba(220, 38, 38, 0.16),
    0 12px 32px rgba(220, 38, 38, 0.12);
  background: linear-gradient(145deg, rgba(42, 54, 72, 0.98), rgba(26, 36, 50, 0.95));
}

.yc-cal-color-field {
  margin-bottom: 8px;
}

.yc-cal-color-field > label {
  display: block;
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.yc-cal-settings-form .modal-actions {
  margin-top: 22px;
}

.yc-cal-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--yc-color, #60a5fa);
  flex-shrink: 0;
}

/* Calendar context menu */
.yc-ctx-menu {
  position: absolute;
  z-index: 300;
  min-width: 240px;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(165deg, #2c3a4f 0%, #1a2433 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

.yc-ctx-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.yc-ctx-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.yc-ctx-item.bold {
  font-weight: 800;
}

.yc-ctx-item.danger {
  color: #f87171;
}

.yc-ctx-item.danger:hover {
  background: rgba(220, 38, 38, 0.16);
}

.yc-ctx-chevron {
  opacity: 0.5;
  font-size: 0.85rem;
}

.yc-ctx-sep {
  height: 1px;
  margin: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
}

.yc-ctx-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 10px;
}

.yc-cal-item.color-blue { --yc-color: #3b82f6; }
.yc-cal-item.color-red { --yc-color: #ef4444; }
.yc-cal-item.color-green { --yc-color: #22c55e; }
.yc-cal-item.color-orange { --yc-color: #f97316; }
.yc-cal-item.color-purple { --yc-color: #a855f7; }
.yc-cal-item.color-pink { --yc-color: #ec4899; }
.yc-cal-item.color-teal { --yc-color: #14b8a6; }
.yc-cal-item.color-yellow { --yc-color: #eab308; }

.yc-rf-note {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yc-rf-note strong { color: #fca5a5; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }

.yc-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.yc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.yc-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.yc-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0 6px;
}

.yc-view-switch {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(23, 31, 40, 0.7);
  border: 1px solid var(--border);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.yc-view-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.yc-view-btn.active {
  background: linear-gradient(145deg, #DC2626, #b91c1c);
  color: #fff;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

.yc-board {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.yc-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.yc-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(100px, 1fr);
  gap: 4px;
  min-height: calc(100% - 28px);
}

.yc-month-day {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  background: rgba(23, 31, 40, 0.35);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 100px;
  transition: border-color var(--transition);
}

.yc-month-day:hover { border-color: rgba(220, 38, 38, 0.4); }
.yc-month-day.out-month { opacity: 0.45; }
.yc-month-day.weekend { background: rgba(148, 163, 184, 0.06); }
.yc-month-day.holiday {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}
.yc-month-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.8);
}

.yc-month-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.yc-month-day-num {
  font-weight: 800;
  font-size: 0.88rem;
}

.yc-rf-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
}

.yc-month-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.yc-event,
.yc-timed-event {
  border: none;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--yc-color, #3b82f6);
  display: flex;
  gap: 4px;
  align-items: center;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.yc-event .yc-ev-time { opacity: 0.85; font-weight: 600; }
.yc-event .yc-ev-title { overflow: hidden; text-overflow: ellipsis; }
.yc-more { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; padding: 0 4px; }

.yc-event.color-blue, .yc-timed-event.color-blue, .yc-agenda-item.color-blue { --yc-color: #3b82f6; background: #3b82f6; }
.yc-event.color-red, .yc-timed-event.color-red, .yc-agenda-item.color-red { --yc-color: #ef4444; background: #ef4444; }
.yc-event.color-green, .yc-timed-event.color-green, .yc-agenda-item.color-green { --yc-color: #22c55e; background: #22c55e; }
.yc-event.color-orange, .yc-timed-event.color-orange, .yc-agenda-item.color-orange { --yc-color: #f97316; background: #f97316; }
.yc-event.color-purple, .yc-timed-event.color-purple, .yc-agenda-item.color-purple { --yc-color: #a855f7; background: #a855f7; }
.yc-event.color-pink, .yc-timed-event.color-pink, .yc-agenda-item.color-pink { --yc-color: #ec4899; background: #ec4899; }
.yc-event.color-teal, .yc-timed-event.color-teal, .yc-agenda-item.color-teal { --yc-color: #14b8a6; background: #14b8a6; }
.yc-event.color-yellow, .yc-timed-event.color-yellow, .yc-agenda-item.color-yellow { --yc-color: #ca8a04; background: #ca8a04; }

/* Tasks panel (week/day) — separate from all-day events */
.yc-tasks-panel {
  margin: 0 0 10px;
  padding: 12px 12px 10px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(249, 115, 22, 0.1), rgba(23, 31, 40, 0.55));
  border: 1px solid rgba(249, 115, 22, 0.22);
  transition: padding 0.2s ease;
}

.yc-tasks-panel.is-collapsed {
  padding-bottom: 12px;
}

.yc-tasks-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.yc-tasks-panel.is-collapsed .yc-tasks-panel-head {
  margin-bottom: 0;
}

.yc-tasks-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.yc-tasks-panel-title strong {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.yc-tasks-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.yc-tasks-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 10px;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.yc-tasks-toggle-btn:hover {
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.14);
  color: #fff;
}

.yc-tasks-toggle-label {
  letter-spacing: -0.01em;
}

.yc-tasks-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.yc-tasks-panel.is-collapsed .yc-tasks-chevron {
  transform: rotate(-90deg);
}

.yc-tasks-panel.is-collapsed .yc-tasks-toggle-btn {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
}

.yc-tasks-body {
  overflow: hidden;
}

.yc-tasks-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fdba74;
  background: rgba(249, 115, 22, 0.18);
  flex-shrink: 0;
}

.yc-tasks-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.yc-tasks-stat {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.2;
}

.yc-tasks-stat.total {
  color: #fdba74;
  background: rgba(249, 115, 22, 0.16);
}

.yc-tasks-stat.done {
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
}

.yc-tasks-stat.open {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

.yc-tasks-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.yc-tasks-day-card {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(23, 31, 40, 0.55);
  border-radius: 12px;
  padding: 10px 10px 8px;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 72px;
}

.yc-tasks-day-card:hover {
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.1);
  transform: translateY(-1px);
}

.yc-tasks-day-card.has-open {
  border-color: rgba(249, 115, 22, 0.35);
}

.yc-tasks-day-card.is-empty {
  opacity: 0.72;
}

.yc-tasks-day-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.yc-tasks-day-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
}

.yc-tasks-day-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.yc-tasks-day-n {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
}

.yc-tasks-day-n.done {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.yc-tasks-day-card.is-empty .yc-tasks-day-n {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.35);
}

.yc-tasks-day-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.25;
}

.yc-tasks-day-preview .done {
  text-decoration: line-through;
  opacity: 0.55;
}

.yc-tasks-day-preview .muted {
  color: rgba(255, 255, 255, 0.35);
}

.yc-task-pill {
  border: none;
  border-radius: 999px;
  padding: 2px 4px 2px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  color: #fdba74;
  background: rgba(249, 115, 22, 0.14);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.yc-task-pill-total {
  color: #fdba74;
}

.yc-task-pill-done {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}

.yc-task-pill:hover {
  background: rgba(249, 115, 22, 0.28);
}

.yc-task-pill:hover .yc-task-pill-total {
  color: #fff;
}

.yc-task-pill.sm {
  margin-top: 4px;
  padding: 1px 3px 1px 5px;
  font-size: 0.65rem;
}

.yc-month-day-badges {
  display: flex;
  align-items: center;
  gap: 4px;
}

.yc-month-day.has-tasks {
  box-shadow: inset 0 -2px 0 rgba(249, 115, 22, 0.45);
}

.yc-timed-task {
  border: 1px dashed rgba(255, 255, 255, 0.35) !important;
}

.yc-timed-task.is-done {
  opacity: 0.55;
  text-decoration: line-through;
}

/* Day tasks popup sheet */
.yc-day-tasks-sheet {
  width: min(420px, calc(100vw - 28px));
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(48, 62, 82, 0.99) 0%, rgba(24, 34, 48, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55), 0 0 50px rgba(249, 115, 22, 0.12);
  overflow: hidden;
  animation: confirmModalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.yc-day-tasks-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.yc-day-tasks-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fdba74;
  margin-bottom: 4px;
}

.yc-day-tasks-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding-right: 36px;
}

.yc-day-tasks-list {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yc-day-tasks-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
}

.yc-day-tasks-empty p {
  margin-bottom: 14px;
}

.yc-day-task-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(23, 31, 40, 0.55);
  overflow: hidden;
  border-left: 4px solid var(--yc-color, #f97316);
}

.yc-day-task-item.color-blue { --yc-color: #3b82f6; }
.yc-day-task-item.color-red { --yc-color: #ef4444; }
.yc-day-task-item.color-green { --yc-color: #22c55e; }
.yc-day-task-item.color-orange { --yc-color: #f97316; }
.yc-day-task-item.color-purple { --yc-color: #a855f7; }
.yc-day-task-item.color-pink { --yc-color: #ec4899; }
.yc-day-task-item.color-teal { --yc-color: #14b8a6; }
.yc-day-task-item.color-yellow { --yc-color: #eab308; }

.yc-day-task-item.is-done {
  opacity: 0.7;
}

.yc-day-task-item.is-done strong {
  text-decoration: line-through;
}

.yc-day-task-check {
  border: none;
  background: transparent;
  color: #fdba74;
  width: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yc-day-task-check .yc-task-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid currentColor;
}

.yc-day-task-item.is-done .yc-day-task-check .yc-task-box {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.1);
}

.yc-day-task-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  padding: 12px 14px 12px 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.yc-day-task-main strong {
  font-size: 0.95rem;
  font-weight: 800;
}

.yc-day-task-main span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.yc-day-tasks-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Week / day time grid */
.yc-timegrid { display: flex; flex-direction: column; min-height: 100%; }
.yc-timegrid-head,
.yc-allday-row {
  display: grid;
  grid-template-columns: 56px repeat(var(--yc-days, 7), 1fr);
  gap: 2px;
  border-bottom: 1px solid var(--border);
}

.yc-timegrid-head { --yc-days: 7; }
.yc-timegrid-dayhead {
  text-align: center;
  padding: 8px 4px;
  font-size: 0.8rem;
}
.yc-timegrid-dayhead.is-today { color: #93c5fd; }
.yc-timegrid-dayhead.holiday { color: #fca5a5; }
.yc-tg-dow { font-weight: 700; color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; }
.yc-tg-date { font-weight: 800; font-size: 1rem; }

.yc-gutter {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.yc-allday-cell {
  min-height: 36px;
  padding: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.yc-timegrid-body {
  display: grid;
  grid-template-columns: 56px 1fr;
  flex: 1;
  min-height: 960px;
  position: relative;
}

.yc-hours {
  display: flex;
  flex-direction: column;
}

.yc-hour-label {
  height: 40px;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
  padding-right: 6px;
  transform: translateY(-6px);
}

.yc-time-cols {
  display: grid;
  grid-template-columns: repeat(var(--yc-days, 7), 1fr);
  border-left: 1px solid var(--border);
}

.yc-time-col {
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.yc-hour-slot {
  height: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.yc-hour-slot:hover { background: rgba(220, 38, 38, 0.06); }

.yc-timed-event {
  position: absolute;
  left: 2px;
  right: 2px;
  z-index: 2;
  flex-direction: column;
  align-items: flex-start;
  padding: 4px 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.yc-timed-event strong { font-size: 0.75rem; }
.yc-timed-event span { font-size: 0.68rem; opacity: 0.9; font-weight: 600; }

/* Day view: 1 column */
.yc-timegrid:has(.yc-time-cols > .yc-time-col:only-child) .yc-timegrid-head,
.yc-timegrid:has(.yc-time-cols > .yc-time-col:only-child) .yc-allday-row {
  grid-template-columns: 56px 1fr;
}
.yc-timegrid:has(.yc-time-cols > .yc-time-col:only-child) .yc-time-cols {
  grid-template-columns: 1fr;
}

.yc-agenda { display: flex; flex-direction: column; gap: 6px; max-width: 720px; margin: 0 auto; }
.yc-agenda-day { margin-top: 10px; padding: 8px 4px 4px; border-bottom: 1px solid var(--border); }
.yc-agenda-day.holiday .yc-agenda-date strong { color: #fca5a5; }
.yc-agenda-date { display: flex; flex-direction: column; gap: 2px; }
.yc-agenda-date span { font-size: 0.8rem; color: var(--text-muted); }

.yc-agenda-item {
  display: flex;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-left: 4px solid var(--yc-color, #3b82f6);
  background: rgba(23, 31, 40, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

.yc-agenda-item:hover { background: rgba(255, 255, 255, 0.05); }
.yc-agenda-time { min-width: 110px; font-size: 0.82rem; font-weight: 700; color: var(--text-muted); }
.yc-agenda-body { display: flex; flex-direction: column; gap: 2px; }
.yc-agenda-meta { font-size: 0.8rem; color: var(--text-muted); }

.yc-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Event preview card */
.yc-card-overlay {
  z-index: 155;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(8, 12, 18, 0.72);
  animation: confirmOverlayIn 0.22s ease;
}

.yc-event-card {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(48, 62, 82, 0.98) 0%, rgba(28, 38, 52, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2),
    0 28px 64px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(59, 130, 246, 0.12);
  overflow: hidden;
  animation: confirmModalIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.yc-card-accent {
  height: 6px;
  width: 100%;
  background: #3b82f6;
}

.yc-card-accent.color-blue { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.yc-card-accent.color-red { background: linear-gradient(90deg, #b91c1c, #f87171); }
.yc-card-accent.color-green { background: linear-gradient(90deg, #15803d, #4ade80); }
.yc-card-accent.color-orange { background: linear-gradient(90deg, #c2410c, #fb923c); }
.yc-card-accent.color-purple { background: linear-gradient(90deg, #7e22ce, #c084fc); }
.yc-card-accent.color-pink { background: linear-gradient(90deg, #be185d, #f472b6); }
.yc-card-accent.color-teal { background: linear-gradient(90deg, #0f766e, #2dd4bf); }
.yc-card-accent.color-yellow { background: linear-gradient(90deg, #a16207, #facc15); }

.yc-card-close {
  position: absolute;
  top: 16px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.yc-card-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.yc-card-body {
  padding: 22px 24px 20px;
}

.yc-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.3);
  margin-bottom: 12px;
}

.yc-event-card.color-red .yc-card-badge { color: #fca5a5; background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.3); }
.yc-event-card.color-green .yc-card-badge { color: #86efac; background: rgba(34, 197, 94, 0.16); border-color: rgba(34, 197, 94, 0.3); }
.yc-event-card.color-orange .yc-card-badge { color: #fdba74; background: rgba(249, 115, 22, 0.16); border-color: rgba(249, 115, 22, 0.3); }
.yc-event-card.color-purple .yc-card-badge { color: #d8b4fe; background: rgba(168, 85, 247, 0.16); border-color: rgba(168, 85, 247, 0.3); }
.yc-event-card.color-pink .yc-card-badge { color: #f9a8d4; background: rgba(236, 72, 153, 0.16); border-color: rgba(236, 72, 153, 0.3); }
.yc-event-card.color-teal .yc-card-badge { color: #5eead4; background: rgba(20, 184, 166, 0.16); border-color: rgba(20, 184, 166, 0.3); }
.yc-event-card.color-yellow .yc-card-badge { color: #fde047; background: rgba(234, 179, 8, 0.16); border-color: rgba(234, 179, 8, 0.3); }

.yc-card-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0 36px 10px 0;
  color: #fff;
}

.yc-card-meta {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  white-space: pre-line;
  line-height: 1.45;
  margin-bottom: 20px;
}

.yc-card-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.yc-card-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(23, 31, 40, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.yc-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
}

.yc-card-row-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.yc-card-row-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
}

.yc-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.yc-event-dialog {
  max-width: 520px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(92dvh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yc-event-dialog .modal-header {
  flex-shrink: 0;
  padding: 16px 20px;
}

.yc-event-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.yc-event-form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 20px 8px;
}

.yc-event-form label {
  display: block;
  margin: 10px 0 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
}
.yc-event-form label:first-child { margin-top: 4px; }

.yc-event-form input[type="text"],
.yc-event-form input[type="datetime-local"],
.yc-event-form select,
.yc-event-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.65);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
}

.yc-event-form textarea {
  min-height: 72px;
  max-height: 160px;
  resize: vertical;
}

.yc-time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.yc-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 10px 0 4px !important;
}

.yc-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.yc-color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.yc-color-dot.color-blue { background: #3b82f6; }
.yc-color-dot.color-red { background: #ef4444; }
.yc-color-dot.color-green { background: #22c55e; }
.yc-color-dot.color-orange { background: #f97316; }
.yc-color-dot.color-purple { background: #a855f7; }
.yc-color-dot.color-pink { background: #ec4899; }
.yc-color-dot.color-teal { background: #14b8a6; }
.yc-color-dot.color-yellow { background: #eab308; }
.yc-color-dot.active { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); border-color: #fff; }

.yc-modal-spacer { flex: 1; }
.yc-event-form .modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--navy-elevated);
}

@media (max-height: 700px) {
  .yc-event-dialog { max-height: min(96dvh, 100vh - 16px); }
  .yc-event-dialog .modal-header { padding: 12px 16px; }
  .yc-event-form-scroll { padding: 2px 16px 6px; }
  .yc-event-form label { margin: 8px 0 4px; }
  .yc-event-form input[type="text"],
  .yc-event-form input[type="datetime-local"],
  .yc-event-form select,
  .yc-event-form textarea { padding: 9px 11px; }
  .yc-event-form .modal-actions { padding: 10px 16px 12px; }
}

@media (max-width: 960px) {
  .yc-time-row { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .yc-layout { grid-template-columns: 1fr; height: auto; }
  .yc-sidebar { max-height: none; }
  .page#page-calendar { height: auto; }
  .yc-month-grid { grid-auto-rows: minmax(80px, auto); }
  .yc-time-row { grid-template-columns: 1fr; }
}

/* ─── Production calendar RF (legacy helpers) ─── */
.cal-year-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  background: linear-gradient(145deg, #DC2626, #b91c1c);
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.35);
}

.cal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.cal-stat {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.cal-stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.cal-stat.work .cal-stat-val { color: #6ee7b7; }
.cal-stat.off .cal-stat-val { color: #fca5a5; }
.cal-stat.hours .cal-stat-val { color: #93c5fd; }

.cal-stat-label {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: rgba(36, 48, 66, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.cal-leg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}

.cal-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
}

.cal-dot.work { background: rgba(52, 211, 153, 0.85); }
.cal-dot.weekend { background: rgba(148, 163, 184, 0.55); }
.cal-dot.holiday { background: #ef4444; }
.cal-dot.transfer { background: #f472b6; }
.cal-dot.today { box-shadow: 0 0 0 2px #fff; background: #60a5fa; }

.cal-year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.cal-month-card {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.cal-month-card:hover {
  border-color: rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}

.cal-month-card.active {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25), var(--shadow);
  background: linear-gradient(165deg, rgba(220, 38, 38, 0.12), rgba(36, 48, 66, 0.98));
}

.cal-month-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.cal-month-card-head strong {
  font-size: 0.95rem;
  font-weight: 800;
}

.cal-month-card-head span {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6ee7b7;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.cal-weekdays.large span {
  font-size: 0.78rem;
  padding: 6px 0;
}

.cal-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
}

.cal-cell.empty { visibility: hidden; }
.cal-cell.work { background: rgba(52, 211, 153, 0.18); color: #a7f3d0; }
.cal-cell.weekend { background: rgba(148, 163, 184, 0.12); color: rgba(255, 255, 255, 0.4); }
.cal-cell.holiday { background: rgba(239, 68, 68, 0.28); color: #fecaca; }
.cal-cell.transfer { background: rgba(244, 114, 182, 0.25); color: #fbcfe8; }
.cal-cell.is-today {
  box-shadow: inset 0 0 0 2px #60a5fa;
  font-weight: 800;
}

.cal-month-detail,
.cal-holidays-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.cal-month-detail-top {
  margin-bottom: 18px;
}

.cal-holidays-card h3,
.cal-month-detail-head h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.cal-holidays-list {
  margin: 0 0 14px;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  line-height: 1.65;
}

.cal-holidays-list strong { color: #fff; }

.cal-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.cal-month-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.cal-month-detail-head h3 {
  margin: 0;
  flex: 1;
  text-align: center;
}

.cal-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cal-detail-stats b { color: #fff; font-weight: 800; }

.cal-lcells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-lcell {
  min-height: 64px;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid transparent;
}

.cal-lcell.empty { visibility: hidden; }
.cal-lcell.work { background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.2); }
.cal-lcell.weekend { background: rgba(148, 163, 184, 0.08); }
.cal-lcell.holiday { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.3); }
.cal-lcell.transfer { background: rgba(244, 114, 182, 0.16); border-color: rgba(244, 114, 182, 0.28); }
.cal-lcell.is-today { box-shadow: inset 0 0 0 2px #60a5fa; }

.cal-lday {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cal-llabel {
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.75;
  text-transform: lowercase;
}

@media (max-width: 1100px) {
  .cal-year-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .cal-year-grid { grid-template-columns: 1fr; }
}

/* ─── Notes (Yandex-style) ─── */
.notes-page-header { margin-bottom: 18px; }

.notes-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 16px;
  min-height: calc(100vh - 200px);
  align-items: stretch;
}

.notes-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: 520px;
  max-height: calc(100vh - 200px);
}

.notes-search-wrap {
  position: relative;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.notes-search-icon {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-40%);
  color: var(--text-muted);
  pointer-events: none;
}

.notes-search {
  width: 100%;
  padding: 11px 12px 11px 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.65);
  color: var(--white);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.notes-search:focus {
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notes-list-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.note-list-item {
  text-align: left;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
  background: rgba(23, 31, 40, 0.45);
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.note-list-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--note-accent, #6b7280);
}

.note-list-item:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.note-list-item.active {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.1);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.15);
}

.note-list-item.color-default { --note-accent: #6b7280; }
.note-list-item.color-yellow { --note-accent: #fbbf24; background: rgba(251, 191, 36, 0.08); }
.note-list-item.color-green { --note-accent: #34d399; background: rgba(52, 211, 153, 0.08); }
.note-list-item.color-blue { --note-accent: #60a5fa; background: rgba(96, 165, 250, 0.08); }
.note-list-item.color-pink { --note-accent: #f472b6; background: rgba(244, 114, 182, 0.08); }
.note-list-item.color-purple { --note-accent: #a78bfa; background: rgba(167, 139, 250, 0.08); }
.note-list-item.color-orange { --note-accent: #fb923c; background: rgba(251, 146, 60, 0.08); }

.note-list-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.note-list-title {
  font-weight: 750;
  font-size: 0.92rem;
  color: #fff;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-pin-mark { font-size: 0.78rem; opacity: 0.9; }

.note-list-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
}

.note-list-date {
  margin-top: 8px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.38);
}

.notes-editor-panel {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 520px;
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.notes-editor-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--note-panel-accent, transparent);
  opacity: 0.9;
}

.notes-editor-panel.panel-color-yellow { --note-panel-accent: #fbbf24; }
.notes-editor-panel.panel-color-green { --note-panel-accent: #34d399; }
.notes-editor-panel.panel-color-blue { --note-panel-accent: #60a5fa; }
.notes-editor-panel.panel-color-pink { --note-panel-accent: #f472b6; }
.notes-editor-panel.panel-color-purple { --note-panel-accent: #a78bfa; }
.notes-editor-panel.panel-color-orange { --note-panel-accent: #fb923c; }
.notes-editor-panel.panel-color-default { --note-panel-accent: #6b7280; }

.notes-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}

.notes-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 38, 38, 0.1);
  color: #fca5a5;
  margin-bottom: 8px;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.notes-empty h2 {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.notes-empty p { margin-bottom: 8px; }

.notes-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.notes-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.note-colors {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.note-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: var(--dot, #6b7280);
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}

.note-color-dot:hover {
  transform: scale(1.12);
}

.note-color-dot.active {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18), 0 0 0 5px var(--dot, #6b7280);
  border-color: rgba(255, 255, 255, 0.55);
}

.notes-editor-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.note-save-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 6px;
}

.note-save-status.saving { color: #fbbf24; }
.note-save-status.saved { color: #6ee7b7; }
.note-save-status.error { color: #f87171; }

#note-pin-btn.is-pinned {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

.note-title-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 18px 20px 8px;
  outline: none;
}

.note-title-input::placeholder { color: rgba(255, 255, 255, 0.28); }


.note-meta-bar {
  padding: 10px 20px 14px;
  border-top: 1px solid var(--border);
}

.note-updated-at {
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .notes-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .notes-sidebar {
    max-height: 320px;
    min-height: 240px;
  }
  .notes-editor-panel {
    max-height: none;
    min-height: 480px;
  }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(220, 38, 38, 0.45); background-clip: padding-box; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .sidebar,
  .sidebar.collapsed {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-border);
    padding: 16px;
    overflow: visible;
  }

  #main-view { flex-direction: column; }

  .sidebar-header {
    flex-direction: row !important;
    align-items: center !important;
    padding: 0 0 12px !important;
  }

  .sidebar-toggle { display: none; }

  .sidebar.collapsed .sidebar-brand-text,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .user-meta {
    display: initial;
  }

  .sidebar.collapsed .nav-section-label { display: none; }

  .sidebar.collapsed .nav-item {
    justify-content: flex-start;
    padding: 12px 14px;
    gap: 12px;
    width: auto;
  }

  .sidebar.collapsed .nav-badge {
    position: static;
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    font-size: 0.72rem;
  }

  .sidebar.collapsed .sidebar-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar.collapsed .user-info {
    justify-content: flex-start;
    width: auto;
    flex: 1;
  }

  .sidebar.collapsed .sidebar-logout {
    width: auto;
  }

  .sidebar.collapsed .logout-icon { display: none; }

  .sidebar-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-section-label { display: none; }

  .nav-item {
    width: auto;
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
  }

  .user-info { margin-bottom: 0; flex: 1; }

  #logout-btn { width: auto; }

  .content { padding: 24px 18px 32px; }

  .page-header.row { flex-direction: column; }
  .page-header h1 { font-size: 1.6rem; }
  .project-detail-header { flex-direction: column; }
  .html-editor-layout.split { grid-template-columns: 1fr; }
  .html-editor-title-row { flex-direction: column; align-items: stretch; }
}


/* Hotkey focus flash for search fields */
.search-field input.search-hotkey-flash,
input.search-hotkey-flash {
  outline: 2px solid var(--accent, #dc2626) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25);
}

#copy-project-link-btn,
.copy-project-link-detail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#copy-project-link-btn svg {
  flex-shrink: 0;
}


/* Ads: subscription fee + metric tooltips */
.ads-metric-label {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ads-metric-label > span:first-child {
  flex: 1;
  min-width: 0;
}

.ads-tip {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  user-select: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.ads-tip:hover,
.ads-tip:focus-visible {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(220, 38, 38, 0.12);
  outline: none;
}

.ads-tip::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  width: min(260px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 25, 32, 0.96);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  text-align: left;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.ads-tip::before {
  content: '';
  position: absolute;
  right: 5px;
  bottom: calc(100% + 2px);
  z-index: 41;
  border: 6px solid transparent;
  border-top-color: rgba(18, 25, 32, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.ads-tip:hover::after,
.ads-tip:hover::before,
.ads-tip:focus-visible::after,
.ads-tip:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ads-be-grid .ads-metric-label {
  margin-bottom: 6px;
}

#ads-field-fee-wrap .ads-input-wrap {
  border-color: rgba(220, 38, 38, 0.22);
}


/* Ads: РСЯ split */
.ads-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 2px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.45);
  cursor: pointer;
  user-select: none;
  transition: border-color var(--transition), background var(--transition);
}
.ads-check:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(23, 31, 40, 0.65);
}
.ads-check:has(input:checked) {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.08);
}
.ads-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ads-check-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  position: relative;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.ads-check input:checked + .ads-check-box {
  border-color: #DC2626;
  background: linear-gradient(145deg, #DC2626, #b91c1c);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}
.ads-check input:checked + .ads-check-box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.ads-check-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ads-check-text strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}
.ads-check-text em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.ads-rsya-panel {
  margin: 0 0 16px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.05);
}
.ads-rsya-panel.hidden { display: none !important; }
.ads-rsya-panel-head {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fca5a5;
  margin-bottom: 12px;
}


/* Notes rich-text format bar */
.note-format-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 6px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.note-fmt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.note-fmt-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.note-fmt-btn:active {
  transform: scale(0.96);
}

.note-fmt-btn.is-active {
  background: rgba(220, 38, 38, 0.22);
  color: #fecaca;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.35);
}

.note-fmt-b { font-weight: 900; }
.note-fmt-i { font-style: italic; font-weight: 700; }
.note-fmt-u { text-decoration: underline; text-underline-offset: 2px; font-weight: 700; }
.note-fmt-s { text-decoration: line-through; font-weight: 700; }

.note-fmt-sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.12);
}

.note-content-input {
  flex: 1;
  width: 100%;
  min-height: 280px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.65;
  padding: 8px 20px 20px;
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-content-input:empty:before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.note-content-input:focus {
  outline: none;
}

.note-content-input b,
.note-content-input strong { font-weight: 800; color: #fff; }

.note-content-input i,
.note-content-input em { font-style: italic; }

.note-content-input u { text-underline-offset: 2px; }

.note-content-input s,
.note-content-input strike,
.note-content-input del { opacity: 0.75; }

.note-content-input ul,
.note-content-input ol {
  margin: 0.4em 0 0.4em 1.2em;
  padding: 0;
}

.note-content-input li { margin: 0.15em 0; }

.note-content-input a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.note-content-input a:hover { color: #bfdbfe; }


/* Note attachments */
.note-attachments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}
.note-attachments.hidden { display: none !important; }
.note-attachments-head {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.note-att-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.note-att-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(36, 48, 66, 0.9);
  color: #fff;
  font-size: 0.84rem;
}
.note-att-item .note-att-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
}
.note-att-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.note-att-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.note-att-size {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
.note-att-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}
.note-att-actions a,
.note-att-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.note-att-actions a:hover,
.note-att-actions button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.note-att-actions button.danger:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}
#note-attach-btn.is-busy {
  opacity: 0.55;
  pointer-events: none;
}
.note-list-att {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}


/* ─── Today focus view ─── */
.yc-today {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 8px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.yc-today-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 20px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 70% 90% at 100% 0%, rgba(220, 38, 38, 0.16), transparent 55%),
    rgba(36, 48, 66, 0.75);
}

.yc-today-hero.holiday {
  background:
    radial-gradient(ellipse 70% 90% at 100% 0%, rgba(248, 113, 113, 0.2), transparent 55%),
    rgba(36, 48, 66, 0.75);
}

.yc-today-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fca5a5;
  margin-bottom: 6px;
}

.yc-today-date {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
}

.yc-today-sub {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.yc-today-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
}

.yc-today-stat {
  min-width: 72px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  text-align: center;
}

.yc-today-stat strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.yc-today-stat span {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.yc-today-stat.is-warn strong { color: #fca5a5; }
.yc-today-stat.is-warn { border-color: rgba(248, 113, 113, 0.35); }

.yc-today-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.yc-today-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(23, 31, 40, 0.4);
  padding: 14px 14px 12px;
}

.yc-today-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.yc-today-section-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.yc-today-section-head span {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 3px 10px;
}

.yc-today-section-head.is-warn h3 { color: #fca5a5; }
.yc-today-section-head.is-warn span {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.14);
}

.yc-today-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yc-today-item {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-left: 4px solid var(--yc-color, #3b82f6);
  background: rgba(36, 48, 66, 0.55);
  border-radius: 12px;
  padding: 0;
  color: inherit;
  font-family: inherit;
  overflow: hidden;
}

.yc-today-item.color-blue { --yc-color: #3b82f6; }
.yc-today-item.color-red { --yc-color: #ef4444; }
.yc-today-item.color-green { --yc-color: #22c55e; }
.yc-today-item.color-orange { --yc-color: #f97316; }
.yc-today-item.color-purple { --yc-color: #a855f7; }
.yc-today-item.color-pink { --yc-color: #ec4899; }
.yc-today-item.color-teal { --yc-color: #14b8a6; }
.yc-today-item.color-yellow { --yc-color: #ca8a04; }

.yc-today-item.is-overdue {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(220, 38, 38, 0.08);
}

.yc-today-item.is-done {
  opacity: 0.88;
  background: rgba(16, 185, 129, 0.06);
}

.yc-today-item.is-done strong {
  text-decoration: line-through;
}

.yc-today-item.is-live {
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35), 0 8px 24px rgba(16, 185, 129, 0.12);
}

.yc-today-item.is-past {
  opacity: 0.7;
}

.yc-today-check {
  flex-shrink: 0;
  width: 44px;
  border: none;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  position: relative;
}

.yc-today-check::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  transition: all 0.15s ease;
}

.yc-today-check.is-checked::before,
.yc-today-check.is-checked {
  /* checked look */
}

.yc-today-check.is-checked::before {
  border-color: #34d399;
  background: #10b981;
  box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.yc-today-check.is-checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 9px;
  margin: -6px 0 0 -2px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.yc-today-check:hover::before {
  border-color: rgba(255, 255, 255, 0.6);
}

.yc-today-item-main,
button.yc-today-event {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px 12px 4px;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

button.yc-today-event {
  padding: 12px 14px;
}

.yc-today-item-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px 12px 0;
}

.yc-today-item-main strong,
.yc-today-item-body strong {
  font-size: 0.95rem;
  font-weight: 800;
}

.yc-today-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.yc-today-time {
  flex-shrink: 0;
  min-width: 88px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  line-height: 1.3;
}

.yc-today-time span {
  display: block;
  font-weight: 600;
  opacity: 0.85;
}

.yc-today-time em {
  display: inline-block;
  margin-top: 4px;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.16);
  border-radius: 999px;
  padding: 2px 8px;
}

.yc-today-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.yc-today-empty {
  text-align: center;
  padding: 18px 12px;
  color: var(--text-muted);
}

.yc-today-empty p { margin: 0 0 10px; font-size: 0.9rem; }

.yc-today-all-empty {
  text-align: center;
  padding: 28px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.yc-today-all-empty h3 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.05rem;
}

.yc-today-all-empty p { margin: 0; font-size: 0.9rem; }

@media (max-width: 700px) {
  .yc-today-hero {
    grid-template-columns: 1fr;
  }
  .yc-today-stats {
    justify-content: flex-start;
  }
  .yc-today-item-main,
  button.yc-today-event {
    flex-direction: column;
    align-items: flex-start;
  }
  .yc-today-time { min-width: 0; }
}


/* Task checklist */
.yc-task-checklist-editor {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}
.yc-task-checklist-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.yc-task-checklist-editor-head label {
  margin: 0 !important;
}
.yc-task-checklist-hint {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}
.yc-task-checklist-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.yc-task-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.yc-task-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.yc-task-check-row input[type="text"] {
  flex: 1;
  min-width: 0;
  margin: 0 !important;
  padding: 9px 11px !important;
}
.yc-task-check-del {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.yc-task-check-del:hover {
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5;
}

.yc-task-checklist-card {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}
.yc-task-checklist-card.hidden { display: none !important; }
.yc-task-checklist-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.yc-task-checklist-card-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.yc-task-card-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.03);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}
.yc-task-card-check-item:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
}
.yc-task-card-check-item:disabled {
  cursor: default;
  opacity: 0.9;
}
.yc-task-card-check-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 5px;
  border: 2px solid rgba(255,255,255,0.35);
  position: relative;
}
.yc-task-card-check-item.is-done .yc-task-card-check-box {
  border-color: #34d399;
  background: #10b981;
}
.yc-task-card-check-item.is-done .yc-task-card-check-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.yc-task-card-check-text {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}
.yc-task-card-check-item.is-done .yc-task-card-check-text {
  text-decoration: line-through;
  opacity: 0.65;
}
.yc-today-meta .yc-check-progress {
  color: #93c5fd;
  font-weight: 700;
}


/* Quick capture */
.yc-quick {
  flex-shrink: 0;
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.45);
}
.yc-quick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.yc-quick-icon {
  flex-shrink: 0;
  color: #fca5a5;
  opacity: 0.85;
}
.yc-quick-input {
  flex: 1 1 220px;
  min-width: 160px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(23, 31, 40, 0.75);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.yc-quick-input::placeholder {
  color: rgba(255,255,255,0.35);
  font-weight: 500;
}
.yc-quick-input:focus {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.yc-quick-type {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
}
.yc-quick-type-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.yc-quick-type-btn.active {
  background: rgba(220, 38, 38, 0.2);
  color: #fecaca;
}
.yc-quick-preview {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: rgba(255,255,255,0.82);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}
.yc-quick-preview.hidden { display: none !important; }
.yc-quick-preview strong { color: #c7d2fe; font-weight: 800; }
.yc-quick-preview em {
  font-style: normal;
  color: #fca5a5;
  font-weight: 800;
}
@media (max-width: 860px) {
  .yc-quick-type { order: 3; width: 100%; justify-content: stretch; }
  .yc-quick-type-btn { flex: 1; }
  #yc-quick-submit { width: 100%; }
}


/* Overdue reschedule */
.yc-today-section-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.yc-today-overdue-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 10px 0;
}
.yc-today-item.is-overdue .yc-today-item-main {
  padding: 0;
}
.yc-today-reschedule {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.yc-resched-btn {
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(220, 38, 38, 0.1);
  color: #fecaca;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.yc-resched-btn:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.22);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fff;
}
.yc-resched-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.yc-resched-bulk {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(220, 38, 38, 0.16);
}
@media (max-width: 700px) {
  .yc-today-overdue-body { padding-right: 8px; }
  .yc-resched-btn { font-size: 0.7rem; padding: 6px 9px; }
}


/* Fit app to viewport without outer page scroll */
@media (max-height: 820px) {
  .sidebar {
    padding: 12px 12px;
  }
  .sidebar-header {
    padding: 4px 4px 12px;
  }
  .nav-item {
    padding: 9px 12px;
    margin-bottom: 4px;
    font-size: 0.88rem;
  }
  .user-info {
    margin-bottom: 8px;
    padding: 8px;
  }
  .sidebar-footer {
    padding-top: 10px;
  }
  .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }
}

/* Prefer dynamic viewport units where supported */
@supports (height: 100dvh) {
  #main-view {
    height: 100dvh;
    max-height: 100dvh;
  }
}

.profile-logout-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 4px;
  width: 100%;
  color: #fca5a5 !important;
  border: 1px solid rgba(248, 113, 113, 0.3) !important;
  background: rgba(220, 38, 38, 0.08) !important;
  font-weight: 700;
}
.profile-logout-btn:hover {
  background: rgba(220, 38, 38, 0.16) !important;
  border-color: rgba(248, 113, 113, 0.5) !important;
  color: #fecaca !important;
}
/* user card as clear clickable profile entry */
.user-info {
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  border: 1px solid transparent;
  position: relative;
}
.user-info:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Ctrl+K global search hint on employee badge */
.user-search-kbd {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin-left: auto;
  flex-shrink: 0;
  padding: 5px 8px !important;
  min-width: 52px;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(96, 165, 250, 0.1) !important;
  color: #93c5fd !important;
  cursor: pointer;
  line-height: 1.15;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.user-search-kbd:hover {
  background: rgba(96, 165, 250, 0.2) !important;
  border-color: rgba(147, 197, 253, 0.45) !important;
  color: #bfdbfe !important;
  transform: translateY(-1px);
}
.user-search-kbd:active {
  transform: translateY(0);
}
.user-search-kbd-keys {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.user-search-kbd-hint {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  color: inherit;
}
.user-meta {
  flex: 1;
  min-width: 0;
}
.sidebar.collapsed .user-search-kbd {
  display: none !important;
}
.sidebar.collapsed .user-meta {
  display: none;
}

/* Task links: folder / note / html */
.yc-task-links-editor {
  margin: 14px 0 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.14);
}
.yc-task-links-editor-head {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.yc-task-links-editor label {
  margin-top: 8px !important;
}
.yc-task-links-editor select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(23, 31, 40, 0.65);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
}
.yc-task-links-card {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.16);
}
.yc-task-links-card.hidden { display: none !important; }
.yc-task-links-head {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.yc-task-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.yc-task-link-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.yc-task-link-chip:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
}
.yc-task-link-chip .yc-link-kind {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
}
.yc-task-link-chip .yc-link-kind.is-folder { color: #fcd34d; background: rgba(252, 211, 77, 0.12); }
.yc-task-link-chip .yc-link-kind.is-note { color: #93c5fd; background: rgba(147, 197, 253, 0.12); }
.yc-task-link-chip .yc-link-kind.is-html { color: #c4b5fd; background: rgba(167, 139, 250, 0.12); }
.yc-task-link-chip .yc-link-kind.is-file { color: #86efac; background: rgba(134, 239, 172, 0.12); }
.yc-task-link-chip .yc-link-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.yc-today-meta .yc-link-dot {
  color: #93c5fd;
  font-weight: 800;
}

/* ─── Linked tasks (reverse links) ─── */
.linked-tasks-block {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}
.linked-tasks-block.compact { margin-top: 10px; margin-bottom: 0; }
.linked-tasks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.linked-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.linked-tasks-list.horizontal {
  flex-direction: row;
  flex-wrap: wrap;
}
.linked-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  max-width: 100%;
}
.linked-tasks-list.horizontal .linked-task-item {
  max-width: 280px;
}
.linked-task-item:hover {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.08);
}
.linked-task-item.is-done {
  opacity: 0.55;
}
.linked-task-item.is-done .linked-task-title {
  text-decoration: line-through;
}
.linked-task-title {
  flex: 1;
  min-width: 0;
  font-weight: 650;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.linked-task-meta {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}
.linked-tasks-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 2px;
}
.linked-tasks-error {
  font-size: 0.85rem;
  color: #fca5a5;
}

/* ─── Recurrence badge ─── */
.yc-task-recurrence-row {
  margin: 0 0 10px;
}
.yc-task-recurrence-row.hidden { display: none !important; }
.yc-recurrence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.25);
}
.yc-today-meta .yc-rec-dot {
  color: #c4b5fd;
  font-weight: 800;
}

/* ─── Command palette (unified search) ─── */
.cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 24px;
}
.cmd-palette.hidden { display: none !important; }
.cmd-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.cmd-palette-sheet {
  position: relative;
  width: min(640px, 100%);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #1a1f2e;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  overflow: hidden;
}
.cmd-palette-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
}
.cmd-palette-search-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
}
.cmd-palette-esc {
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
}
.cmd-palette-results {
  overflow: auto;
  padding: 8px;
  flex: 1;
}
.cmd-palette-hint,
.cmd-palette-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.cmd-palette-group {
  margin-bottom: 6px;
}
.cmd-palette-group-title {
  padding: 8px 10px 4px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.cmd-palette-item:hover,
.cmd-palette-item.is-active {
  background: rgba(96, 165, 250, 0.12);
}
.cmd-palette-kind {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cmd-palette-kind.is-project { color: #fcd34d; background: rgba(252,211,77,0.12); }
.cmd-palette-kind.is-file { color: #86efac; background: rgba(134,239,172,0.12); }
.cmd-palette-kind.is-note { color: #93c5fd; background: rgba(147,197,253,0.12); }
.cmd-palette-kind.is-html { color: #c4b5fd; background: rgba(167,139,250,0.12); }
.cmd-palette-kind.is-task { color: #fdba74; background: rgba(251,146,60,0.12); }
.cmd-palette-item-main {
  flex: 1;
  min-width: 0;
}
.cmd-palette-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmd-palette-item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Wave 1: status / assignee / templates / filters ─── */
.yc-task-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}
@media (max-width: 520px) {
  .yc-task-row-2 { grid-template-columns: 1fr; }
}
.yc-task-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.yc-status-badge,
.yc-assignee-badge,
.yc-recurrence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.yc-status-badge.hidden,
.yc-assignee-badge.hidden,
.yc-recurrence-badge.hidden { display: none !important; }
.yc-status-badge { border: 1px solid transparent; }
.yc-status-badge.is-todo { color: #cbd5e1; background: rgba(148,163,184,0.12); border-color: rgba(148,163,184,0.25); }
.yc-status-badge.is-in_progress { color: #93c5fd; background: rgba(59,130,246,0.14); border-color: rgba(96,165,250,0.3); }
.yc-status-badge.is-waiting { color: #fcd34d; background: rgba(251,191,36,0.12); border-color: rgba(252,211,77,0.28); }
.yc-status-badge.is-review { color: #c4b5fd; background: rgba(167,139,250,0.14); border-color: rgba(167,139,250,0.3); }
.yc-status-badge.is-done { color: #86efac; background: rgba(34,197,94,0.12); border-color: rgba(134,239,172,0.28); }
.yc-assignee-badge {
  color: #fda4af;
  background: rgba(251,113,133,0.12);
  border: 1px solid rgba(251,113,133,0.28);
}
.yc-task-links-hint {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  opacity: 0.75;
  margin-left: 6px;
}
.yc-task-link-chip {
  position: relative;
  padding-right: 28px !important;
}
.yc-link-detach {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 0;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.yc-link-detach:hover {
  background: rgba(248,113,113,0.2);
  color: #fecaca;
}
.yc-task-templates {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.yc-task-templates.hidden { display: none !important; }
.yc-task-templates-head {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.yc-task-templates-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.yc-tpl-btn {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.yc-tpl-btn:hover {
  border-color: rgba(96,165,250,0.45);
  background: rgba(96,165,250,0.12);
}
.yc-tpl-btn.is-active {
  border-color: rgba(96,165,250,0.55);
  background: rgba(96,165,250,0.18);
  color: #bfdbfe;
}
.yc-today-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0 2px;
}
.yc-today-filter {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.18);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.yc-today-filter:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.yc-today-filter.is-active {
  color: #bfdbfe;
  border-color: rgba(96,165,250,0.45);
  background: rgba(96,165,250,0.14);
}
.yc-today-filter.is-toggle.is-active {
  color: #fcd34d;
  border-color: rgba(252,211,77,0.4);
  background: rgba(252,211,77,0.1);
}
.yc-today-status-pill {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  vertical-align: middle;
}
.yc-today-status-pill.is-todo { color: #cbd5e1; background: rgba(148,163,184,0.15); }
.yc-today-status-pill.is-in_progress { color: #93c5fd; background: rgba(59,130,246,0.15); }
.yc-today-status-pill.is-waiting { color: #fcd34d; background: rgba(251,191,36,0.15); }
.yc-today-status-pill.is-review { color: #c4b5fd; background: rgba(167,139,250,0.15); }
.yc-today-status-pill.is-done { color: #86efac; background: rgba(34,197,94,0.15); }
.yc-today-item.is-status-waiting { box-shadow: inset 3px 0 0 #fbbf24; }
.yc-today-item.is-status-review { box-shadow: inset 3px 0 0 #a78bfa; }
.yc-today-item.is-status-in_progress { box-shadow: inset 3px 0 0 #60a5fa; }

.yc-task-link-chip .yc-link-open {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
