/* ------------------------------------------------------------
   North Anchor look. Navy, cream, brass.
   Phone first; the desktop rules are at the bottom.
   ------------------------------------------------------------ */

:root {
  --navy: #0e1c30;
  --navy-deep: #0b1727;
  --navy-soft: #24344b;
  --gold: #c2a06a;
  --cream: #f4efe6;
  --ground: #f7f6f3;
  --card: #ffffff;
  --line: #e3e0da;
  --rule: #efede8;
  --text: #1a2433;
  --muted: #5c6775;
  --faint: #8a939f;
  --red: #b3261e;
  --red-bg: #f8e6e4;
  --green: #1e6b45;
  --green-bg: #e4f0e9;
  --blue: #2c5f8a;
  --blue-bg: #e7eff6;
  --purple: #8a6aae;
  --purple-bg: #ede8f4;
  --sand-bg: #fbf1e0;
  --sand-fg: #7a5a20;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Jost, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--ground);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--text); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.005em; }

/* ---- top bar ---- */
.topbar { background: var(--navy); color: var(--cream); }
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 16px;
}
.brand-name { display: block; line-height: 1.1; font-size: 14px; font-weight: 600; letter-spacing: 0.09em; }
.brand-sub { display: block; font-size: 9.5px; font-weight: 400; letter-spacing: 0.19em; color: #9fb0c4; }
.topnav { display: flex; flex-wrap: wrap; gap: 3px; }
.topnav a {
  padding: 7px 13px; border-radius: 7px; text-decoration: none;
  color: #d7dee8; font-size: 15px;
}
.topnav a.on { background: var(--gold); color: var(--navy); font-weight: 500; }
.topbar-right { margin-left: auto; font-size: 13px; color: #9fb0c4; }
.topbar-right a { color: #9fb0c4; }

/* ---- page ---- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 22px 16px 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 18px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 500; }
.page-head p { margin: 0 0 5px; color: var(--muted); font-size: 15px; }

.cols { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.col-wide { flex: 999 1 540px; min-width: 0; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-half { flex: 1 1 380px; min-width: 0; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px 20px 10px;
}
.card h2 { margin: 0 0 3px; font-size: 18px; }
.card .sub { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.card-dark { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.card-dark h2 { color: var(--gold); font-size: 12px; letter-spacing: 0.11em; margin-bottom: 2px; }
.card-pad { padding-bottom: 20px; }

/* ---- the day list ---- */
.day-row {
  display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--rule);
}
.day-row:first-child { border-top: 0; }
.day-bar { flex: 0 0 4px; border-radius: 2px; background: var(--muted); }
.k-work .day-bar { background: var(--blue); }
.k-build .day-bar { background: var(--green); }
.k-event .day-bar { background: var(--purple); }
.k-task .day-bar { background: var(--faint); }
.k-waiting .day-bar { background: var(--red); }
.day-when { flex: 0 0 66px; font-size: 13px; color: var(--muted); padding-top: 2px; }
.day-main { flex: 1 1 auto; min-width: 0; }
.day-title { font-size: 16px; font-weight: 500; }
.day-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.day-meta .text { font-size: 13px; color: var(--muted); }

.tag {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em;
  padding: 3px 8px; border-radius: 4px; background: #eef0f3; color: var(--muted);
}
.t-work { background: var(--blue-bg); color: #214a6b; }
.t-build { background: var(--green-bg); color: #175436; }
.t-event { background: var(--purple-bg); color: #5b4080; }
.t-task { background: #eef0f3; color: #4b5563; }
.t-waiting { background: var(--red-bg); color: #8c1d17; }

.check {
  width: 29px; height: 29px; border-radius: 8px; border: 1.5px solid #c6ccd4;
  background: #fff; cursor: pointer;
}
.check:hover { border-color: var(--navy); }

/* ---- quick add ---- */
.quick { display: flex; flex-wrap: wrap; gap: 9px; padding: 13px 0 15px; border-top: 1px solid var(--rule); }
.quick input[type=text] {
  flex: 999 1 220px; min-width: 0; font: inherit; font-size: 15px;
  padding: 11px 12px; border: 1px solid #d7d3cb; border-radius: 8px; background: #fcfbf9;
}
.quick input[type=date] {
  flex: 0 1 160px; font: inherit; font-size: 15px; padding: 10px 11px;
  border: 1px solid #d7d3cb; border-radius: 8px; background: #fcfbf9;
}

/* ---- buttons ---- */
.btn {
  font: inherit; font-size: 15px; font-weight: 500; padding: 11px 20px;
  border: 1px solid #d7d3cb; border-radius: 8px; background: #fff;
  color: var(--text); cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-primary { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.btn-wide { width: 100%; text-align: center; }
.btn-small { padding: 7px 13px; font-size: 14px; }

/* ---- the clock ---- */
.clock-num { margin: 0 0 12px; font-size: 30px; font-weight: 500; line-height: 1.1; }
.clock-note { margin: 0 0 14px; font-size: 14px; color: #b9c6d6; }
.meter { height: 7px; border-radius: 4px; background: var(--navy-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gold); }
.meter-legend { margin-top: 8px; display: flex; justify-content: space-between; font-size: 12px; color: #9fb0c4; }

/* ---- lists and tables ---- */
.line {
  display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule);
  align-items: flex-start;
}
.line:first-child { border-top: 0; }
.dot { flex: 0 0 9px; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--muted); }
.dot-red { background: var(--red); }
.dot-gold { background: var(--gold); }
.dot-green { background: var(--green); }
.line-main { flex: 1 1 auto; min-width: 0; }
.line-title { font-size: 15px; font-weight: 500; }
.line-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.line-flag { flex: 0 0 auto; font-size: 12px; font-weight: 600; }

.scroll-x { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 15px; }
table.grid th {
  text-align: left; font-size: 11.5px; letter-spacing: 0.07em;
  color: var(--muted); font-weight: 600; padding: 0 12px 9px 0;
}
table.grid td { padding: 12px 12px 12px 0; border-top: 1px solid var(--rule); }
table.grid td:last-child, table.grid th:last-child { padding-right: 0; }
.num { text-align: right; }
.faint { color: var(--faint); }
.muted { color: var(--muted); }

/* ---- the week strip ---- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { border: 1px solid var(--rule); border-radius: 9px; padding: 7px 7px 9px; background: #fff; }
.week-day.on { background: #fbf7ef; border-color: #e8dcc3; }
.week-dow { font-size: 10.5px; letter-spacing: 0.07em; color: var(--muted); }
.week-num { font-size: 18px; font-weight: 500; }
.week-pips { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
/* The class has to out-specify ".week-pips span", or every pip comes
   out grey - the same specificity trap that flattened the buy list. */
.week-pips span { height: 5px; border-radius: 3px; background: var(--faint); }
.week-pips span.pip-work, .legend i.pip-work { background: var(--blue); }
.week-pips span.pip-build, .legend i.pip-build { background: var(--green); }
.week-pips span.pip-event, .legend i.pip-event { background: var(--purple); }
.week-pips span.pip-task, .legend i.pip-task { background: var(--faint); }
.week-pips span.pip-waiting, .legend i.pip-waiting { background: var(--red); }

.legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 5px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ---- stat tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.tile .k { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); }
.tile .v { margin: 6px 0 3px; font-size: 26px; font-weight: 500; }
.tile .s { font-size: 13px; color: var(--muted); }

/* ---- flashes, empties ---- */
.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 14px; font-size: 15px; }
.flash-error { background: var(--red-bg); color: #8c1d17; }
.flash-success { background: var(--green-bg); color: #175436; }
.empty { color: var(--muted); font-size: 15px; padding: 10px 0 18px; }

/* ---- sign-in ---- */
.gate { max-width: 400px; margin: 9vh auto; padding: 0 18px; }
.gate h1 { font-size: 24px; margin: 0 0 6px; font-weight: 500; }
.gate p { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.gate label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.gate input {
  display: block; width: 100%; font: inherit; font-size: 16px; margin-top: 5px;
  padding: 11px 12px; border: 1px solid #d7d3cb; border-radius: 8px; background: #fff;
}

/* ---- desktop ---- */
@media (min-width: 900px) {
  .wrap { padding: 28px 24px 72px; }
  .page-head h1 { font-size: 34px; }
  .card { padding: 22px 24px 12px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- the month grid ---- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-head {
  font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted);
  padding: 0 0 4px 3px;
}
.month-cell {
  min-height: 92px; border: 1px solid var(--rule); border-radius: 8px;
  padding: 5px 5px 7px; background: #fff; overflow: hidden;
}
.month-cell.off-month { background: #fbfaf8; }
.month-cell.off-month .month-num { color: var(--faint); }
.month-cell.is-today { background: #fbf7ef; border-color: #e8dcc3; }
.month-cell.blocked { background: #f4f1ea; }
.month-num {
  display: inline-block; font-size: 14px; font-weight: 500;
  text-decoration: none; margin-bottom: 3px;
}
.month-cell div[class^="chip-"] {
  font-size: 11px; line-height: 1.3; padding: 2px 5px; border-radius: 4px;
  margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip-event { background: var(--purple-bg); color: #5b4080; }
.chip-build { background: var(--green-bg); color: #175436; }
.chip-task { background: #eef0f3; color: #4b5563; }
.chip-waiting { background: var(--red-bg); color: #8c1d17; }
.month-more { font-size: 10.5px; color: var(--muted); padding-left: 4px; }

@media (max-width: 760px) {
  .month-cell { min-height: 68px; padding: 4px 3px 5px; }
  .month-cell div[class^="chip-"] { font-size: 9.5px; padding: 1px 3px; }
  .month-num { font-size: 12px; }
}

/* ---- the second row of tabs ---- */
.subbar { background: var(--navy-deep); }
.subbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 16px;
  display: flex; flex-wrap: wrap; gap: 2px;
}
.subbar-inner a {
  padding: 9px 13px; font-size: 14px; color: #93a3b8; text-decoration: none;
  border-bottom: 2px solid transparent;
}
.subbar-inner a:hover { color: #d7dee8; }
.subbar-inner a.on { color: var(--cream); border-bottom-color: var(--gold); }
