:root {
  --bg: #f3f5ef;
  --bg-deep: #d8e3d5;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #1b2d2a;
  --muted: #5e716d;
  --line: rgba(27, 45, 42, 0.12);
  --line-strong: rgba(27, 45, 42, 0.2);
  --shadow: 0 24px 60px rgba(27, 45, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --status-not-started: #7d8c89;
  --status-in-progress: #2a6f97;
  --status-waiting: #b7791f;
  --status-done: #2c7a4b;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 38%),
    linear-gradient(145deg, #edf3e7 0%, #dce8df 52%, #f8f2ea 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(27, 45, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 45, 42, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.background-glow {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}

.background-glow-left {
  top: -8rem;
  left: -10rem;
  background: rgba(67, 170, 139, 0.4);
}

.background-glow-right {
  right: -6rem;
  bottom: -10rem;
  background: rgba(219, 154, 70, 0.32);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.tab-bar {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.tab-button {
  border: 1px solid rgba(27, 45, 42, 0.08);
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(27, 45, 42, 0.06);
}

.tab-button.is-active {
  background: linear-gradient(135deg, #214f5a, #2f8d7a);
  color: #f7fbfa;
  border-color: transparent;
}

.hero-panel,
.composer-panel,
.board-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-panel {
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding: 0.9rem 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(27, 45, 42, 0.08);
  box-shadow: 0 14px 30px rgba(27, 45, 42, 0.08);
}

.brand-logo {
  width: clamp(80px, 9vw, 112px);
  height: auto;
  display: block;
  flex-shrink: 0;
}

.brand-copy {
  display: grid;
  gap: 0.25rem;
}

.brand-name,
.brand-text {
  margin: 0;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-text {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.6rem;
}

.hero-text,
.board-hint,
.form-message,
.empty-state p,
.meta-text,
.summary-label {
  color: var(--muted);
}

.hero-text {
  max-width: 48rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.6;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.settings-form {
  display: grid;
  grid-template-columns: minmax(180px, 220px) auto minmax(180px, 1fr);
  gap: 0.85rem;
  align-items: end;
  margin-top: 1.25rem;
}

.summary-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(27, 45, 42, 0.08);
}

.summary-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.9rem;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}

.workspace-single {
  grid-template-columns: minmax(0, 1fr);
}

.hidden-panel {
  display: none;
}

.composer-panel,
.board-panel {
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}

.composer-panel {
  position: sticky;
  top: 1rem;
}

.panel-heading {
  margin-bottom: 1.25rem;
}

.project-form,
.field,
.task-entry {
  display: grid;
  gap: 0.55rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.field span,
.card-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
select,
textarea,
.task-text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  padding: 0.85rem 0.95rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

input:focus,
select:focus,
textarea:focus,
.task-text-input:focus {
  outline: none;
  border-color: rgba(42, 111, 151, 0.55);
  box-shadow: 0 0 0 4px rgba(42, 111, 151, 0.12);
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-2px);
}

.primary-button {
  padding: 0.95rem 1.1rem;
  font-weight: 700;
  color: #f7fbfa;
  background: linear-gradient(135deg, #214f5a, #2f8d7a);
  box-shadow: 0 14px 30px rgba(33, 79, 90, 0.24);
}

.secondary-button {
  padding: 0.72rem 1rem;
  background: rgba(33, 79, 90, 0.1);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  background: rgba(216, 87, 79, 0.12);
  color: #932f2f;
}

.form-message {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.95rem;
}

.board-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.board-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.project-list-panel,
.board-detail {
  min-height: 24rem;
}

.project-list-panel {
  display: grid;
  gap: 0.75rem;
}

.list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-list {
  display: grid;
  gap: 0.65rem;
}

.project-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(27, 45, 42, 0.08);
  border-left: 6px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  text-align: left;
  box-shadow: 0 10px 26px rgba(27, 45, 42, 0.06);
}

.project-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(27, 45, 42, 0.1);
}

.project-list-item.is-selected {
  border-color: rgba(42, 111, 151, 0.18);
  border-left-color: #214f5a;
  background: rgba(255, 255, 255, 0.96);
}

.project-list-item-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-item-subtitle {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-list-item-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.badge.badge-rank {
  background: rgba(33, 79, 90, 0.1);
  color: #214f5a;
}

.readonly-field {
  background: rgba(243, 245, 239, 0.9);
  color: var(--muted);
}

.board-detail {
  display: grid;
}

.embedded-panel {
  min-height: 70vh;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(27, 45, 42, 0.09);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 36px rgba(27, 45, 42, 0.08);
}

.embedded-frame {
  display: block;
  width: 100%;
  min-height: 70vh;
  border: 0;
  background: #fff;
}

.codex-projects-list {
  display: grid;
  gap: 1rem;
}

.codex-project-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.15rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 45, 42, 0.09);
  box-shadow: 0 14px 36px rgba(27, 45, 42, 0.08);
}

.empty-state {
  padding: 3rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.project-card {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 45, 42, 0.09);
  border-left: 8px solid var(--status-not-started);
  box-shadow: 0 14px 36px rgba(27, 45, 42, 0.08);
  animation: card-rise 320ms ease both;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 42px rgba(27, 45, 42, 0.12);
}

.project-card.status-Not-Started {
  border-left-color: var(--status-not-started);
}

.project-card.status-In-Progress {
  border-left-color: var(--status-in-progress);
}

.project-card.status-Waiting {
  border-left-color: var(--status-waiting);
}

.project-card.status-Done {
  border-left-color: var(--status-done);
}

.card-topbar,
.card-footer,
.task-row,
.task-controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.card-topbar,
.card-footer {
  justify-content: space-between;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge.priority-High {
  background: rgba(216, 87, 79, 0.12);
  color: #962b34;
}

.badge.priority-Medium {
  background: rgba(219, 154, 70, 0.16);
  color: #8c5707;
}

.badge.priority-Low {
  background: rgba(47, 141, 122, 0.14);
  color: #1f6d61;
}

.save-state {
  min-height: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-title-input {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  box-shadow: none;
}

.project-title-input:focus {
  box-shadow: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.card-notes {
  min-height: 7.5rem;
  max-height: 10rem;
}

.checklist-block {
  padding: 0.95rem;
  border-radius: 18px;
  background: rgba(243, 245, 239, 0.95);
  border: 1px solid rgba(27, 45, 42, 0.08);
}

.task-list {
  display: grid;
  gap: 0.65rem;
  margin: 0.8rem 0 0;
}

.task-row {
  align-items: flex-start;
}

.task-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.85rem;
  accent-color: #2f8d7a;
}

.task-text-input {
  flex: 1;
  min-height: 2.6rem;
  padding-right: 0.8rem;
}

.task-entry {
  margin-top: 0.85rem;
}

.task-controls {
  justify-content: space-between;
}

.meta-text {
  margin: 0;
  font-size: 0.88rem;
}

.delete-project {
  background: rgba(216, 87, 79, 0.1);
  color: #942a2a;
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .composer-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 1rem, 1400px);
    padding-top: 1rem;
  }

  .hero-panel,
  .composer-panel,
  .board-panel {
    padding: 1.15rem;
  }

  .summary-strip,
  .settings-form,
  .field-row,
  .card-grid,
  .board-heading,
  .board-workspace {
    grid-template-columns: 1fr;
    display: grid;
  }

  .brand-lockup {
    flex-direction: column;
    align-items: flex-start;
  }

  .embedded-panel,
  .embedded-frame {
    min-height: 82vh;
  }

  .card-topbar,
  .card-footer,
  .task-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .card-badges {
    width: 100%;
  }

  .board-grid {
    grid-template-columns: 1fr;
  }
}
