:root {
  --bg: #17212b;
  --card: #1f2c38;
  --text: #e9edf2;
  --muted: #a1afbd;
  --accent: #2aabee;   /* Telegram blue */
  --accent-2: #229ed9;
  --border: #223446;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  --safe-top: calc(env(safe-area-inset-top, 24px) + 16px);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  scrollbar-width: none;
  overflow: -moz-scrollbars-none;
  -ms-overflow-style: none;
  padding-top: var(--safe-top); /* ????? ??????? ??? ????????? ?? ?????????? ??????? */
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); /* место под нижнее меню и iOS safe-area */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.page-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(34, 52, 70, 0.6), rgba(23, 33, 43, 0.95));
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;
  padding: 20px 24px 16px;
  background: rgba(27, 40, 52, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-toggle {
  display: none !important;
}

/* ?????? ????????? */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 180;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(22, 33, 45, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  width: calc(100% - 24px);
  max-width: 520px;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 14px;
  text-decoration: none;
  color: #d9e2ee;
  font-weight: 700;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease, transform 0.15s ease;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.bottom-nav__item span {
  font-size: 11px;
  font-weight: 700;
}

.bottom-nav__item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

body.nav-hidden .site-header {
  display: none;
}

.nav {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 120ms ease, transform 120ms ease;
}
.nav a.icon-link {
  font-size: 18px;
  padding: 8px 8px;
}
.nav a:hover {
  background: rgba(42, 171, 238, 0.12);
  transform: translateY(-1px);
}

.user {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
}
.tag {
  background: rgba(42, 171, 238, 0.12);
  color: #d6efff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}

main.card {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 32px auto;
  background: var(--card);
  padding: 32px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

h1 { margin: 0 0 10px; }
.muted { color: var(--muted); margin: 0 0 18px; }
.settings-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.settings-card .stack {
  width: 100%;
  max-width: 320px;
  flex-direction: column;
}
.settings-card label { margin-bottom: 6px; display: block; color: var(--text); }
.settings-card input[type="email"],
.settings-card input[type="text"] {
  width: 100%;
  max-width: none;
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #243447;
  background: #0f1a24;
  color: var(--text);
}
.btn-saved {
  background: linear-gradient(135deg, #2f7d42, #3fa75d);
  box-shadow: 0 8px 18px rgba(47, 125, 66, 0.35);
}
.empty-gap { margin-top: 12px; }

form.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.select-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.fancy-select {
  width: 100%;
  appearance: none;
  background: #0f1a24;
  color: var(--text);
  border: 1px solid #243447;
  border-radius: 12px;
  padding: 12px 42px 12px 14px;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 18px rgba(0,0,0,0.25);
}
.fancy-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(42,171,238,0.35);
}

.goals-hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
}
.goals-hero h1 {
  margin-bottom: 0;
  letter-spacing: -0.02em;
}
.goals-hero .muted {
  margin-bottom: 0;
}
.goals-control-form,
.goal-create-form {
  width: 100%;
  padding: 14px;
  margin-bottom: 14px;
  background: rgba(15, 26, 36, 0.42);
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.goals-control-form {
  flex-direction: column;
  gap: 8px;
}
.goals-control-form .meta {
  margin: 0;
  color: #c8d4e1;
  font-size: 13px;
  font-weight: 800;
}
.goals-control-form .select-wrap {
  max-width: none;
}
.goals-control-form .fancy-select,
.goal-create-form .compact-input {
  height: 44px;
  min-height: 44px;
  border-radius: 14px;
  border-color: rgba(56, 189, 248, 0.2);
  background: rgba(9, 17, 26, 0.78);
}
.goal-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
}
.goal-create-form .compact-input {
  flex: 1 1 auto;
  min-width: 0;
}
.goal-create-form button {
  min-width: 148px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2aabee, #2477c7);
  box-shadow: 0 12px 24px rgba(42, 171, 238, 0.2);
}
.goals-tabs {
  margin: 2px 0 18px;
  padding: 4px;
  gap: 4px;
  background: rgba(9, 17, 26, 0.52);
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 16px;
}
.goals-tabs .tab-btn {
  flex: 1 1 0;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: #c9d6e5;
}
.goals-tabs .tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(42, 171, 238, 0.28), rgba(42, 171, 238, 0.12));
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.26), 0 8px 18px rgba(0, 0, 0, 0.2);
  transform: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 18px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.modal-title { font-weight: 700; font-size: 18px; }
.modal-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  padding: 2px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.comments-list {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
  margin-bottom: 12px;
}
.comment-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 8px;
}
.comment-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.comment-text {
  font-size: 14px;
  white-space: pre-wrap;
}
.comment-form textarea {
  width: 100%;
  margin: 0 0 12px 0;
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #243447;
  background: #0f1a24;
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 14px rgba(0,0,0,0.25);
  resize: vertical;
}\n.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(42,171,238,0.35);
}

.comment-inline {
  margin-top: 12px;
  width: 100%;
}
.comment-inline-form.is-hidden {
  display: none;
}
.comment-inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}
.comment-inline textarea {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #243447;
  background: #0f1a24;
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 14px rgba(0,0,0,0.25);
  resize: vertical;
}
.client-comment-form textarea {
  background: rgba(255, 158, 94, 0.12);
  border: 1px solid rgba(255, 158, 94, 0.45);
  color: #ffe8d6;
}
.client-comment-form textarea:focus {
  outline: 1px solid rgba(255, 158, 94, 0.75);
  border-color: rgba(255, 158, 94, 0.75);
  box-shadow: 0 0 0 2px rgba(255, 158, 94, 0.15);
}
.comment-inline textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(42,171,238,0.35);
}
.comment-icon {
  font-size: 18px;
}
.comment-inline-item {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 210, 88, 0.1);
  border: 1px solid rgba(255, 210, 88, 0.3);
}
.comment-inline-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.comment-inline-text {
  font-size: 14px;
  white-space: pre-wrap;
}
.comment-inline .send-btn {
  padding: 8px 12px;
  min-width: 44px;
  flex: 0 0 48px;
}
.comment-inline-list { width: 100%; }
.comment-inline-item { width: 100%; }
/* ?????????: ?????? ????? ???????????? ?????, ????? ?? ????????????? ? WebApp */
.settings-card form.stack {
  flex-direction: column;
  align-items: stretch;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  gap: 6px;
}

/* ???? ??????? ?????? ? ??????? */
.settings-card p,
.settings-card .muted {
  margin-bottom: 10px;
}

input[type="text"], input[type="number"], input[type="email"], input[type="tel"] {
  flex: 1 1 260px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #243447;
  font-size: 15px;
  background: #0f1a24;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  height: 40px;
  min-height: 40px;
}
.compact-input {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 9px 12px;
  flex: 1 1 220px;
  width: 100%;
}

.task-textarea {
  width: 100%;
  max-width: 100%;
  min-height: 220px; /* ~4 ??????, ????????? ?????? */
  height: auto !important;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #243447;
  background: #0f1a24;
  color: var(--text);
  font-size: 15px;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.4;
  
}

button {
  background: linear-gradient(135deg, #2f4d6d, #26425f);
  color: #e9edf2;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  box-shadow: 0 8px 18px rgba(38, 66, 95, 0.35);
}
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.items {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 10px;
}
.items li { width: 100%; box-sizing: border-box; 
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: #1a2532;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 10px;
  position: relative;
  min-width: 0;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 6px;
}
.dot-goal { background: var(--accent); }
.dot-value { background: var(--accent-2); }
.item-body { display: flex; flex-direction: column; gap: 4px; }
.item-body { width: 100%; min-width: 0; }
.item-text {
  font-weight: 600;
  word-break: break-word;
}
.item-meta {
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}
.item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  align-items: center;
}
.inline-form {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(47, 77, 109, 0.4);
  box-shadow: none;
}
button.ghost:hover {
  transform: none;
  background: rgba(47, 77, 109, 0.14);
}

.ghost-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(47, 77, 109, 0.35);
  box-shadow: none;
  padding: 8px 12px;
  border-radius: 10px;
}
.ghost-btn:hover {
  background: rgba(47, 77, 109, 0.16);
}
.ghost-btn.fullwidth, .inline-form.fullwidth .ghost-btn {
  width: 100%;
  display: inline-flex;
  justify-content: center;
}
.ghost-btn.resp-assign-btn {
  font-size: 14px;
  padding: 8px 12px;
}
.inline-form.fullwidth {
  width: 100%;
}
.inline-form.fullwidth .ghost-btn {
  flex: 1 1 auto;
}
.in-progress-btn {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
}
.in-progress-btn:hover {
  background: rgba(52, 211, 153, 0.15);
}

.icon-btn {
  padding: 8px 10px;
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 16px;
  border-radius: 10px;
  box-shadow: none;
}
.icon-btn.danger {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.3);
  box-shadow: none;
}
.plan-item.is-completed {
  background: rgba(26, 37, 50, 0.55);
  border-color: rgba(47, 77, 109, 0.6);
  position: relative;
  overflow: hidden;
}
.plan-item .item-text {
  position: relative;
}
.plan-item.is-completed .item-text {
  opacity: 0.75;
}
.plan-item.is-completed::after {
  content: "✔";
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  display: grid;
  place-items: center;
  color: #22c55e;
  font-size: 32px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.12);
  backdrop-filter: blur(1px);
  pointer-events: none;
}
.plan-item.is-completed > * { position: relative; z-index: 1; }
.edit-form {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 420px;
  min-width: 260px;
  padding: 12px;
  background: rgba(17, 24, 33, 0.98);
  border: 1px solid rgba(42, 171, 238, 0.2);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  z-index: 2000;
}
.item-body { position: relative; }
.edit-form.open { display: block; }
.edit-form .inline-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 70vh;
  overflow-y: auto;
}
.edit-form .inline-form input {
  min-width: 100%;
  width: 100%;
}
.edit-form .inline-form textarea.compact-area {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #243447;
  background: #0f1a24;
  color: var(--text);
  font-size: 15px;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  line-height: 1.4;
}
.inline-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  font-size: 13px;
  color: var(--muted);
}
.inline-chip input {
  accent-color: #38bdf8;
  width: 16px;
  height: 16px;
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  width: 100%;
  min-width: 0;
}
.tab-btn {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: 1px solid rgba(42, 171, 238, 0.3);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-btn.active {
  background: rgba(42, 171, 238, 0.15);
  transform: translateY(-1px);
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.plan-item.is-completed.archived {
  filter: grayscale(0.3);
  opacity: 0.9;
}

.pill {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(56, 189, 248, 0.12);
  border-radius: 10px;
  color: var(--text);
}

/* Login */
.login-body {
  display: grid;
  place-items: center;
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(440px, 90vw);
  background: var(--card);
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.alert {
  background: #3f1d2e;
  color: #fda4af;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.rejected-list {
  width: 100%;
  max-width: 100%;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.rejected-list .rejected-title {
  margin: 6px 0;
  font-weight: 600;
}
.rejected-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rejected-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: #1a2532;
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
}

.user-grid {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.user-card {
  background: #1a2532;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}
.user-name {
  font-weight: 700;
  color: #dbe9f6;
  word-break: break-word;
}
.user-id {
  color: var(--muted);
  font-size: 14px;
}

.team-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.team-card form.stack {
  max-width: 100%;
  width: 100%;
}
.team-card .stack input,
.team-card .stack select,
.team-card .stack textarea {
  width: 100%;
  max-width: 100%;
  height: 46px;
  min-height: 46px;
  white-space: normal;
}
.team-section h2 {
  margin: 0 0 10px;
}
.members-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.select-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #243447;
  background: #0f1a24;
  color: var(--text);
  font-size: 14px;
  appearance: none;
}
.task-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-card {
  background: #1a2532;
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.task-text {
  font-weight: 600;
  color: #e9edf2;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.task-meta {
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.task-card.completed::after {
  content: "✔";
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  color: #22c55e;
  background: rgba(16, 185, 129, 0.12);
  backdrop-filter: blur(1px);
}
.task-card.completed {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25);
}
.task-card .complete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #22c55e;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
.task-card .complete-form {
  position: absolute;
  top: 0;
  right: 0;
}
.task-card .complete-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}
.task-card .task-text,
.task-card .task-meta {
  padding-right: 38px;
}
.task-scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  color: #e9edf2;
  text-decoration: none;
  word-break: break-word;
  white-space: normal;
}
.badge.urgent {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}
.badge.important {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.35);
}
.badge.deadline {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.35);
}
.badge.in-progress {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}
 .priority-row {\n  display: flex;\n  gap: 8px;\n  flex-wrap: nowrap;\n  justify-content: flex-start;\n  align-items: center;\n  width: 100%;\n}\n

.toggle-chip input {
  display: none;
}
.toggle-chip .chip-body {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1a24;
  color: var(--text);
  font-weight: 700;
  flex: 1 1 0;
  text-align: center;
  flex: 1 1 0;
  text-align: center;
  min-width: 0;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.toggle-chip input:checked + .chip-body.urgent {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.18);
}
.toggle-chip input:checked + .chip-body.important {
  background: rgba(234, 179, 8, 0.18);
  border-color: rgba(250, 204, 21, 0.45);
  color: #facc15;
  box-shadow: 0 6px 14px rgba(234, 179, 8, 0.18);
}
.fancy-date {
  background: #0f1a24;
  border: 1px solid #243447;
  color: var(--text);
  border-radius: 10px;
  height: 42px;
  padding: 10px 12px;
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.eta-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  width: 100%;
  max-width: 260px;
}
.eta-form .eta-input {
  width: 100%;
}
.eta-form .in-progress-btn {
  width: 100%;
}
.danger-ghost {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #1f2c38;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  padding: 20px;
  width: min(420px, 95vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-card h3 {
  margin: 0 0 6px;
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 6px;
    text-align: center;
  }
  .nav { justify-content: center; }
  main.card { margin: 20px; padding: 24px; }
  form.stack { flex-direction: column; }
  .goal-create-form {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .goals-control-form {
    padding: 12px;
  }
  button { width: 100%; text-align: center; }
  .tabs {
    gap: 6px;
  }
  .tabs .tab-btn {
    width: auto;
    min-height: 36px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.2;
  }
  .items {
    margin-top: 16px;
    gap: 12px;
  }
  .items li {
    gap: 10px;
    padding: 14px 12px;
    border-radius: 10px;
  }
  .badge-row {
    gap: 6px;
  }
  .item-text {
    line-height: 1.35;
  }
  .item-actions {
    gap: 8px;
    margin-top: 8px;
  }
  .item-actions .icon-btn {
    width: 44px;
    flex: 0 0 44px;
  }
  .priority-quick .chip-btn {
    width: auto;
  }
  .bulk-task-form {
    grid-template-columns: 1fr;
  }
  .bulk-task-form .ghost-btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  main.card {
    margin: 14px;
    padding: 24px;
    border-radius: 14px;
  }
  h1 {
    font-size: 30px;
    line-height: 1.12;
  }
  .tabs .tab-btn {
    padding: 8px 9px;
    font-size: 13px;
  }
  .items li {
    grid-template-columns: 14px minmax(0, 1fr);
  }
}

.deadline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.deadline-compact {
  width: 150px;
  min-height: 34px;
  height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  flex: 0 0 auto;
}
.deadline-inline {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  min-height: 28px;
  height: 28px;
  padding: 4px 6px;
  border-radius: 10px;
  border: 1px solid #243447;
  background: #0f1a24;
  color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  flex: 0 0 56px !important;
}
.deadline-inline::-webkit-calendar-picker-indicator {
  filter: invert(100%);
  opacity: 0.9;
}
.deadline-inline::-webkit-datetime-edit {
  color: transparent;
}
.deadline-inline:focus::-webkit-datetime-edit {
  color: transparent;
}



.priority-item { flex: 1 1 0; min-width: 0; }
.deadline-wrap { position: relative; width: 64px; height: 42px; flex: 0 0 64px; display:flex; align-items:center; justify-content:center; cursor: pointer; }

.deadline-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
  color: #e5e7eb;
  line-height: 1;
}







.file-field{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.file-btn{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:10px;border:1px solid rgba(42,171,238,0.35);background:#122131;color:var(--text);cursor:pointer;font-weight:700;box-shadow:0 6px 14px rgba(15,26,36,0.35);} 
.file-btn:hover{border-color:rgba(42,171,238,0.6);} 
.file-btn input{display:none;} 
.file-hint{color:var(--muted);font-size:13px;}

.file-list{color:var(--muted);font-size:13px;}


.phone-input{letter-spacing:0.5px;}




/* iOS fix: compact deadline icon aligned with priority buttons */
.priority-row .chip-body { min-width: 82px; width: 100%; }
.deadline-wrap { position: relative; width: 64px; height: 42px; flex: 0 0 64px; display:flex; align-items:center; justify-content:center; cursor: pointer; }
.deadline-wrap .deadline-inline { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; z-index: 5; pointer-events: auto; }
.deadline-wrap .deadline-icon { position: absolute; inset: 0; display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 10px; border: 1px solid #243447; background: #0f1a24; color: var(--text); font-size: 18px; pointer-events: none; }

.deadline-row{display:flex;align-items:center;gap:8px;margin-top:6px;margin-bottom:0;}






/* tighten gap between deadline and textarea on team form */
.team-card .task-textarea{ margin-top:6px; }







.deadline-label{font-size:12px;color:var(--muted);line-height:1.3;}





/* --- overrides: deadline / priority layout tidy --- */
.priority-row{display:flex;gap:8px;align-items:center;flex-wrap:nowrap;width:100%;}
.priority-row .chip-body{min-width:82px;}
.deadline-row{display:flex;align-items:center;gap:8px;margin-top:15px;margin-bottom:0px;}
.deadline-wrap{position:relative;width:64px;height:42px;flex:0 0 64px;display:flex;align-items:center;justify-content:center;cursor:pointer;}
.deadline-wrap .deadline-inline{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;-webkit-appearance:none;appearance:none;z-index:5;pointer-events:auto;}
.deadline-wrap .deadline-icon{position:absolute;inset:0;display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:10px;border:1px solid #243447;background:#0f1a24;color:var(--text);font-size:18px;pointer-events:none;}
.deadline-label{font-size:12px;color:var(--muted);line-height:1.2;transform: translateY(-20px);}
.team-card .task-textarea{ margin-top:-30px; }


.priority-row input[type='checkbox']{display:none !important;}


.team-card .stack select.select-input{flex:1 1 100%; width:100%; max-width:100%;}



.modal-card .comment-form textarea {
  width: 100%;
  margin: 0 0 12px 0;
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #243447;
  background: #0f1a24;
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 14px rgba(0,0,0,0.25);
  resize: vertical;
}





.modal-card .comment-form textarea {
  width: 100%;
  background: #0f1a24;
  color: var(--text);
  border: 1px solid #243447;
  border-radius: 14px;
}


.comment-inline-meta, .comment-meta { display: flex; align-items: center; gap: 6px; }
.comment-inline-actions, .comment-actions { display: inline-flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.icon-btn.mini { width: 26px; height: 26px; padding: 4px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.comment-inline-item { padding: 8px 10px; }
.comment-inline-text { margin-top: 4px; }
.comment-item { padding: 8px 10px; }
.comment-text { margin-top: 4px; }


/* comments layout overrides */
.comment-meta, .comment-inline-meta { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.comment-author, .comment-date { white-space: nowrap; }
.comment-inline-actions, .comment-actions { display: inline-flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.icon-btn.mini { width: 24px; height: 24px; padding: 3px; font-size: 11px; }
.comment-item, .comment-inline-item { padding: 8px 10px; }
.comment-text, .comment-inline-text { margin-top: 4px; }
.comment-actions .icon-btn,
.comment-inline-actions .icon-btn {
  background: rgba(42, 171, 238, 0.14);
  border: 1px solid rgba(42, 171, 238, 0.35);
  color: #e9edf2;
}
.comment-actions .icon-btn.danger,
.comment-inline-actions .icon-btn.danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}
.priority-quick { gap: 6px; flex-wrap: wrap; margin: 4px 0 6px 0; }
.priority-quick .inline-form { display: inline-flex; }
textarea,
.compact-area {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(47, 77, 109, 0.72);
  background: #0f1a24;
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
textarea::placeholder,
.compact-area::placeholder {
  color: #7f8d9b;
}
textarea:focus,
.compact-area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(42, 171, 238, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.bulk-task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin: 0 0 16px;
}
.bulk-task-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 84px;
  margin: 0;
  resize: vertical;
}
.bulk-task-form .ghost-btn {
  min-width: 136px;
}
.prompt-list {
  margin-top: 12px;
}
.prompt-card h2 {
  font-size: 20px;
  line-height: 1.2;
}
.prompt-form {
  width: 100%;
}
.prompt-label {
  display: block;
  margin: 10px 0 6px;
  color: var(--text);
  font-weight: 800;
}
.prompt-default {
  width: 100%;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(47, 77, 109, 0.72);
  background: rgba(15, 26, 36, 0.72);
}
.prompt-default summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}
.prompt-default pre {
  max-height: 340px;
  overflow: auto;
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #dce7f3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}
.prompt-editor {
  width: 100%;
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}
.chip-btn {
  width: auto;
  min-width: 72px;
  border: 1px solid rgba(47, 77, 109, 0.45);
  background: rgba(47, 77, 109, 0.2);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}
.chip-btn.active-urgent { background: rgba(239, 68, 68, 0.12); border-color: rgba(248, 113, 113, 0.35); color: #f87171; }
.chip-btn.active-important { background: rgba(234, 179, 8, 0.12); border-color: rgba(250, 204, 21, 0.35); color: #facc15; }

.demand-row { gap: 8px; margin: 6px 0; }
.demand-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid transparent;
}
.demand-btn.yellow { background: #fbbf24; border-color: rgba(251,191,36,0.6); }
.demand-btn.green { background: #34d399; border-color: rgba(52,211,153,0.6); }
.demand-btn.blue { background: #60a5fa; border-color: rgba(96,165,250,0.6); }
.demand-btn.active { box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }

.task-card.demand-yellow .task-text { color: #fbbf24; }
.task-card.demand-green .task-text { color: #34d399; }
.task-card.demand-blue .task-text { color: #60a5fa; }
.task-card.demand-yellow { border-color: rgba(251,191,36,0.4); }
.task-card.demand-green { border-color: rgba(52,211,153,0.35); }
.task-card.demand-blue { border-color: rgba(96,165,250,0.35); }



.comment-actions button, .comment-inline-actions button {
  background: rgba(42,171,238,0.12);
  border: 1px solid rgba(42,171,238,0.3);
}
.comment-actions .danger, .comment-inline-actions .danger {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.4);
  color: #fca5a5;
}
