:root {
  --navy-980: #02070c;
  --navy-950: #06111d;
  --navy-900: #091826;
  --navy-850: #0d2234;
  --navy-800: #122d43;
  --navy-700: #1a3b55;
  --gold-600: #b9872d;
  --gold-500: #d5a64f;
  --gold-300: #f0cf88;
  --ivory: #f7f1e6;
  --muted: #aeb9c5;
  --soft: #dce4ec;
  --line: rgba(240, 207, 136, 0.22);
  --line-cool: rgba(220, 228, 236, 0.13);
  --danger: #e06c64;
  --success: #68c486;
  --info: #6fb2de;
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--navy-980);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ivory);
  background:
    radial-gradient(circle at 18% 0%, rgba(213, 166, 79, 0.18), transparent 28rem),
    radial-gradient(circle at 100% 20%, rgba(111, 178, 222, 0.11), transparent 32rem),
    linear-gradient(135deg, var(--navy-980), var(--navy-950) 48%, #03080e);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 34px;
  cursor: pointer;
  color: #08111b;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 900;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  color: var(--ivory);
  background: rgba(3, 8, 13, 0.58);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(220, 228, 236, 0.48);
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  border-color: var(--gold-300);
  box-shadow: 0 0 0 3px rgba(213, 166, 79, 0.16);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: 100vh;
}

.project-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 16px;
  background: rgba(5, 14, 23, 0.92);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand-panel {
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 11px;
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.46));
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold-300);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  font-size: 1.18rem;
  line-height: 1.08;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 8px;
  padding: 3px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line-cool);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 850;
}

.sync-pill.online {
  color: var(--success);
}

.sync-pill.saving {
  color: var(--gold-300);
}

.sync-pill.offline {
  color: var(--danger);
}

.new-project-form,
.search-wrap,
.panel,
.project-hero {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 45, 67, 0.72), rgba(9, 24, 38, 0.72));
  box-shadow: var(--shadow);
}

.new-project-form {
  display: grid;
  gap: 8px;
  padding: 11px;
  border-radius: 8px;
}

label {
  color: var(--gold-300);
  font-size: 0.76rem;
  font-weight: 900;
}

.field-help {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.inline-field,
.task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-wrap {
  padding: 8px;
  border-radius: 8px;
  box-shadow: none;
}

.project-list {
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.project-item {
  width: 100%;
  display: grid;
  gap: 5px;
  min-height: 64px;
  text-align: left;
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  padding: 10px;
  box-shadow: none;
}

.project-item:hover {
  border-color: rgba(240, 207, 136, 0.45);
  background: rgba(240, 207, 136, 0.08);
}

.project-item.active {
  border-color: var(--gold-300);
  background: linear-gradient(180deg, rgba(213, 166, 79, 0.18), rgba(18, 45, 67, 0.72));
}

.project-item strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.project-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.workspace {
  min-width: 0;
  padding: 18px;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: stretch;
  gap: 16px;
  min-height: 188px;
  padding: 18px;
  border-radius: 8px;
}

.hero-copy {
  min-width: 0;
}

.project-hero h2 {
  margin-bottom: 8px;
  color: var(--gold-300);
  font-size: clamp(1.55rem, 3.2vw, 3.1rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

#projectDescription {
  max-width: 78ch;
  margin-bottom: 0;
  color: var(--soft);
  font-size: 0.94rem;
  line-height: 1.45;
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.metric {
  min-width: 0;
  padding: 10px;
  background: rgba(2, 7, 12, 0.34);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
}

.metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 850;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  color: var(--ivory);
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.progress-box {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 13px;
  background: rgba(2, 7, 12, 0.32);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
}

.progress-box span {
  color: var(--gold-300);
  font-size: clamp(1.65rem, 3.4vw, 2.7rem);
  font-weight: 950;
  line-height: 1;
}

.progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  background: rgba(3, 8, 13, 0.75);
  border-radius: 999px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--gold-300));
  transition: width 180ms ease;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
  padding: 6px;
  background: rgba(5, 14, 23, 0.74);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  backdrop-filter: blur(18px);
}

.tab-button {
  color: var(--soft);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tab-button.active {
  color: #07121d;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
}

.panel {
  display: none;
  border-radius: 8px;
  padding: 16px;
}

.panel.active {
  display: block;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h3 {
  margin-bottom: 0;
  color: var(--gold-300);
  font-size: 1.12rem;
}

.panel-heading p {
  max-width: 58ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.38;
}

.comment-feed {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.empty-state {
  color: var(--muted);
  padding: 13px;
  background: rgba(2, 7, 12, 0.24);
  border: 1px dashed rgba(245, 239, 227, 0.2);
  border-radius: 8px;
}

.comment {
  display: grid;
  gap: 8px;
  padding: 11px;
  background: rgba(2, 7, 12, 0.32);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
}

.comment-meta,
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.comment-meta strong {
  color: var(--gold-300);
}

.comment-message {
  margin: 0;
  color: var(--ivory);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.comment a {
  color: var(--gold-300);
  font-weight: 850;
}

.comment-image {
  width: min(100%, 560px);
  max-height: 240px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ghost-button,
.reaction-button,
.comment-tool-button {
  min-height: 32px;
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line-cool);
  padding: 6px 9px;
  box-shadow: none;
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 58px;
}

.reaction-button span {
  line-height: 1;
}

.reaction-button strong {
  font-size: 0.88rem;
}

.reaction-button.active {
  color: #07121d;
  background: var(--gold-300);
  border-color: var(--gold-300);
}

.comment-tool-button.danger,
.danger-button,
.task-delete {
  color: var(--ivory);
  background: rgba(224, 108, 100, 0.16);
  border: 1px solid rgba(224, 108, 100, 0.48);
}

.comment-form,
.progress-editor {
  display: grid;
  gap: 10px;
}

.comment-form {
  padding: 11px;
  background: rgba(2, 7, 12, 0.3);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
}

.comment-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.file-picker {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  padding: 0 12px;
}

.file-picker input {
  display: none;
}

.progress-editor {
  max-width: 760px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-form {
  max-width: 760px;
}

.task-stats {
  margin: 10px 0 0;
  color: var(--gold-300);
  font-weight: 900;
}

.task-list {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}

.task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(2, 7, 12, 0.32);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
}

.task-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-500);
}

.task-row.done .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.task-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-state {
  color: var(--gold-300);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.task-delete {
  padding: 7px 9px;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .project-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .workspace,
  .project-sidebar {
    padding: 12px;
  }

  .brand-panel {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .brand-logo {
    width: 54px;
    height: 54px;
  }

  .project-hero {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .project-metrics,
  .tabs,
  .comment-tools {
    grid-template-columns: 1fr;
  }

  .tabs {
    position: static;
  }

  .panel-heading {
    display: grid;
  }

  .task-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-state,
  .task-delete {
    grid-column: 2;
    justify-self: start;
  }
}
