:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #73737b;
  --line: #e7e7ea;
  --soft: #f5f6f8;
  --surface: #fff;
  --accent: #b4d234;
  --accent-dark: #849d16;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(17, 24, 39, .09);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--soft); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.center-view { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.wide-card { width: min(760px, 100%); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup p, .eyebrow { margin: 0 0 2px; font-weight: 800; font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.brand-lockup h1 { margin: 0; font-size: 24px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); font-weight: 900; font-size: 20px; }
.lead { color: var(--muted); line-height: 1.6; margin: 24px 0; }
.stack-form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 750; color: #404047; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; background: #fff; color: var(--ink); outline: none; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #9eb82b; box-shadow: 0 0 0 3px rgba(180, 210, 52, .18); }
.primary, .secondary, .danger-button { border: 0; border-radius: 11px; padding: 11px 15px; font-weight: 800; }
.primary { background: var(--accent); color: #273100; }
.primary:hover { background: #c0df42; }
.secondary { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.danger-button { background: #fff1f0; color: var(--danger); }
.link-button { width: 100%; margin-top: 16px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.tab-row { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); padding: 4px; border-radius: 12px; margin: 24px 0 18px; }
.tab { border: 0; padding: 9px; border-radius: 9px; background: transparent; font-weight: 700; color: var(--muted); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
details { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 25px; }
.choice-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 12px; }
.choice-card h2 { margin: 0; font-size: 17px; }
.choice-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.main-layout { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: #181a1b; color: #fff; padding: 22px 16px; display: flex; flex-direction: column; }
.sidebar-brand { padding: 0 7px 20px; }
.sidebar-brand h1 { font-size: 19px; }
.sidebar-brand p { color: #9a9b9e; }
.select-label { color: #aaa; padding: 0 6px; }
.select-label select { background: #252728; color: #fff; border-color: #333638; margin-top: 3px; }
.project-nav { margin-top: 24px; display: grid; gap: 5px; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; color: #8f9194; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.nav-heading button { border: 0; color: #fff; background: transparent; font-size: 18px; }
.project-link, .sidebar-action { width: 100%; border: 0; background: transparent; color: #c7c8ca; border-radius: 9px; padding: 9px 10px; text-align: left; font-size: 13px; }
.project-link:hover, .project-link.active, .sidebar-action:hover { background: #292c2e; color: #fff; }
.project-link.active { box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-footer { margin-top: auto; display: grid; gap: 3px; border-top: 1px solid #303234; padding-top: 12px; }
.sidebar-action.muted { color: #8e9092; }
.content { min-width: 0; padding: 30px; }
.content-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.content-header h2 { margin: 0; font-size: 27px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.search-wrap { position: relative; width: 230px; }
.search-wrap span { position: absolute; left: 11px; top: 9px; color: var(--muted); font-size: 18px; }
.search-wrap input { padding-left: 34px; background: #fff; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 19px; }
.summary-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0 18px; }
.summary-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.summary-card span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.summary-card strong { font-size: 22px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 13px; overflow-x: auto; padding-bottom: 20px; }
.board-column { min-height: 520px; background: #eceef1; border: 1px solid #e2e4e8; border-radius: 16px; padding: 10px; }
.board-column.drag-over { outline: 3px solid rgba(180,210,52,.5); }
.column-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 5px 12px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #575961; }
.column-header b { background: #fff; padding: 3px 7px; border-radius: 999px; font-size: 10px; }
.column-tasks { display: grid; gap: 9px; align-content: start; min-height: 450px; }
.task-card { background: #fff; border: 1px solid #dedfe3; border-radius: 13px; padding: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.03); cursor: pointer; }
.task-card:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.07); }
.task-card.dragging { opacity: .45; }
.task-project { display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #687800; background: #f2f8d7; border-radius: 999px; padding: 4px 6px; margin-bottom: 8px; }
.task-card h3 { margin: 0; font-size: 13px; line-height: 1.4; }
.task-description { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.task-due { font-size: 10px; color: var(--muted); }
.task-due.overdue { color: var(--danger); font-weight: 700; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #252728; color: #fff; font-size: 9px; font-weight: 800; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; background: #9ba0a8; }
.priority-high, .priority-urgent { background: #d92d20; }
.priority-medium { background: #f79009; }
.priority-low { background: #12b76a; }
.dialog { border: 0; padding: 0; border-radius: 20px; background: transparent; max-width: calc(100vw - 32px); }
.dialog::backdrop { background: rgba(12,14,15,.62); backdrop-filter: blur(3px); }
.dialog-card { width: min(650px, calc(100vw - 32px)); background: #fff; padding: 22px; border-radius: 20px; display: grid; gap: 15px; box-shadow: var(--shadow); }
.small-card { width: min(460px, calc(100vw - 32px)); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; }
.dialog-header h2 { margin: 0; font-size: 22px; }
.close-button { border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 10px; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-two { grid-column: span 2; }
.dialog-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; margin-top: 3px; }
.join-code-box { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.join-code-box span { font-size: 11px; color: var(--muted); }
.join-code-box strong { grid-column: 1; font-size: 28px; letter-spacing: .14em; }
.join-code-box button { grid-row: 1 / span 2; grid-column: 2; }
.helper { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0; }
.member-list { display: grid; gap: 8px; max-height: 270px; overflow-y: auto; }
.member-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.member-row .avatar { flex: 0 0 auto; }
.member-row div { min-width: 0; }
.member-row strong, .member-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row strong { font-size: 12px; }
.member-row span { color: var(--muted); font-size: 10px; }
.toast { position: fixed; right: 22px; bottom: 22px; background: #171819; color: #fff; padding: 12px 15px; border-radius: 11px; box-shadow: var(--shadow); font-size: 12px; z-index: 50; }
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 205px minmax(0, 1fr); }
  .content { padding: 22px 18px; }
  .content-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; }
  .search-wrap { flex: 1; width: auto; }
  .summary-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
  .main-layout { display: block; }
  .sidebar { position: static; height: auto; }
  .project-nav, .sidebar-footer { display: none; }
  .choice-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
}
.member-info { flex: 1; min-width: 0; }
.member-remove-button {
  flex: 0 0 auto;
  border: 1px solid #f4c7c3;
  background: #fff6f5;
  color: var(--danger);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 800;
}
.member-remove-button:hover { background: #ffebe9; }

.connection-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1000;
  max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 999px;
  background: #292929; color: white; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  font-size: 13px; text-align: center;
}
.install-button {
  position: fixed; right: 18px; bottom: 18px; z-index: 999; border: 0; border-radius: 999px;
  padding: 12px 18px; background: #171717; color: white; font: inherit; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); cursor: pointer;
}
.is-offline #newTaskButton, .is-offline #newProjectButton { opacity: .55; }

@media (max-width: 900px) {
  #mainView { display: block; min-height: 100dvh; }
  .sidebar { width: 100%; height: auto; min-height: 0; position: static; padding: 14px 16px; }
  .sidebar nav { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; }
  .sidebar .nav-heading, #projectLinks { display: contents; }
  .sidebar-footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .sidebar-footer button { flex: 1 1 auto; }
  .content { padding: 18px 14px 90px; }
  .content-header { align-items: flex-start; gap: 14px; }
  .header-actions { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .search-wrap { grid-column: 1 / -1; width: 100%; }
  #newTaskButton { min-height: 44px; }
  .summary-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 84vw); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 16px; }
  .board-column { scroll-snap-align: start; min-height: 360px; }
  dialog { width: 100%; max-width: none; margin: auto 0 0; }
  .dialog-card, .small-card { width: 100%; max-width: none; border-radius: 22px 22px 0 0; max-height: 92dvh; overflow-y: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
}

@media (max-width: 520px) {
  .brand-lockup h1 { font-size: 24px; }
  .center-view { padding: 16px; }
  .auth-card, .wide-card { padding: 22px 18px; border-radius: 20px; }
  .content-header { display: block; }
  .header-actions { margin-top: 14px; }
  .summary-card { padding: 14px; }
  .summary-card strong { font-size: 24px; }
  .dialog-actions { grid-template-columns: 1fr 1fr; }
  .dialog-actions > span { display: none; }
  .dialog-actions .danger-button { grid-column: 1 / -1; }
}

.sidebar-action.notification-enabled { color: #b4d234; font-weight: 800; }
.sidebar-action:disabled { opacity: .55; cursor: not-allowed; }
