:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #8d8d93;
  --line: #1c1c1e;
  --blue: #4da3ff;
  --magenta: #ff3d8a;
  --teal: #2ee6c7;
  --card: #111111;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 18px 118px;
  background: var(--bg);
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top h1 {
  margin: 6px 0 0;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.top__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.clock {
  font-variant-numeric: tabular-nums;
}

.status {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status--ok {
  color: var(--teal);
}

.status--error {
  color: var(--magenta);
}

.text-btn,
.tab,
.fab {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.text-btn {
  color: var(--blue);
  padding: 0;
}

.upcoming {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.day-group {
  min-height: 48px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.day-group.is-over {
  outline: 1px dashed var(--blue);
  outline-offset: 6px;
}

.day-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.day-num {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.day-head strong {
  display: block;
  font-size: 16px;
}

.day-head small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.item-row.is-dragging,
.color-card.is-dragging {
  opacity: 0.55;
}

.item-row,
.color-card {
  width: 100%;
  text-align: left;
  color: inherit;
  border: none;
  cursor: grab;
}

.item-row {
  display: grid;
  grid-template-columns: 72px 22px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  background: transparent;
}

.item-row .time {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.item-row .check {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  padding: 0;
  border: 1.5px solid #fff;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

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

.title {
  font-size: 16px;
  font-weight: 600;
}

.sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.color-card {
  display: block;
  margin: 8px 0;
  padding: 16px 16px 14px;
  border-radius: 22px;
  background: var(--blue);
  color: #041018;
}

.color-card.is-magenta {
  background: var(--magenta);
  color: #fff;
}

.color-card.is-teal {
  background: var(--teal);
  color: #041018;
}

.color-card.is-white {
  background: #f4f4f5;
  color: #111;
}

.color-card .label {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.color-card .due {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card strong {
  display: block;
  font-size: 18px;
}

.progress {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--p, 0%), #222 0);
  position: relative;
  flex-shrink: 0;
}

.progress::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--bg);
}

.project-hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 14px 0 18px;
}

.project-hero h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

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

.section-label {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.task-line {
  display: grid;
  grid-template-columns: 22px 18px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.star {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
}

.star.is-on {
  color: #f5c242;
}

.task-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.pill {
  color: var(--muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #161616;
}

.add-in-section {
  margin: 8px 0 0;
  color: var(--muted);
}

.inline-add {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
}

.inline-add input,
.sheet input,
.sheet select,
.sheet textarea,
.field select,
.field textarea {
  flex: 1;
  width: 100%;
  background: #0b0b0b;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color-scheme: dark;
}

#sheet-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#sheet-fields label,
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.status-pill.unpaid {
  color: var(--magenta);
}

.status-pill.paid {
  color: var(--teal);
}

.status-pill.filed {
  color: var(--muted);
}

.grid-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.airtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.airtable th,
.airtable td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.airtable th {
  color: var(--muted);
  font-weight: 600;
  background: #0a0a0a;
}

.airtable tr {
  cursor: pointer;
}

.airtable tr.is-open,
.airtable tr:hover {
  background: #111;
}

.airtable .neg {
  color: var(--magenta);
}

.airtable .pos {
  color: var(--teal);
}

.sheet-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.fab {
  position: fixed;
  right: max(18px, calc(50% - 342px));
  bottom: 86px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  box-shadow: 0 10px 30px rgba(77, 163, 255, 0.35);
  z-index: 6;
}

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 8px 8px 14px;
  background: #000;
  border-top: 1px solid var(--line);
  z-index: 5;
}

.tab {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px;
}

.tab.is-active {
  color: #fff;
}

.tab__icon {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: end center;
  z-index: 8;
}

.sheet[hidden] {
  display: none;
}

.sheet__form {
  width: min(720px, 100%);
  background: #0b0b0b;
  border-top: 1px solid var(--line);
  padding: 18px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet__form h3 {
  margin: 0 0 6px;
}

.sheet__actions {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.btn {
  border: none;
  background: var(--blue);
  color: #041018;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #000;
  padding: 24px;
}

.login-card {
  width: min(380px, 100%);
}

.login-card h1 {
  margin: 8px 0 0;
}

.login-card__sub,
.login-form label {
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.login-form input {
  background: #0b0b0b;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.login-error {
  color: var(--magenta);
}

.empty {
  color: var(--muted);
  font-size: 14px;
}
