@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;600&family=Merriweather:wght@400;700&display=swap');

:root {
  /* Prevent Chrome dark mode auto-theming of form controls */
  color-scheme: light;
  --theme-color: #0f6e7a;
  --kpi-bg: #e0f4f6;
}

body.dark {
  color-scheme: dark;
  background: #121212;
  color: #eee;
  --kpi-bg: #333;
}

body.dark main {
  background: #1e1e1e;
  color: #eee;
}

body.dark nav.tabs button {
  background: #333;
  color: #eee;
}

body.dark nav.tabs button.active {
  background: var(--theme-color);
  color: #fff;
}

body.dark input,
body.dark select,
body.dark textarea {
  color: #000;
  background: #fff;
}

body.dark input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

body.dark #progressBarContainer {
  border-color: #eee;
  background: #333;
}

body {
  font-family: 'Instrument Sans', sans-serif;
  background: #fff;
  color: #222;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-size: 1.125rem;
  line-height: 1.6;
}

nav.tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0 0.5rem;
}
nav.tabs button {
  padding: 0.5rem 1rem;
  border: none;
  background: #eee;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  font: inherit;
}
nav.tabs button.active {
  background: var(--theme-color);
  color: #fff;
}

@media (max-width: 600px) {
  nav.tabs {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  nav.tabs button {
    flex: 1 0 30%;
  }
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.social-links h3 {
  margin: 0;
  margin-right: 0.5rem;
  font-size: 1rem;
}
.social-links a {
  color: inherit;
}
.social-links svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

header {
  background-image: url('claudio-testa-so3jte3gzo-unsplash-dark-small.png');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  position: relative;
}
header h1 {
  font-family: 'Merriweather', serif;
  margin: 0;
}

main {
  max-width: 900px;
  margin: 2rem auto;
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.container {
  display: flex;
  gap: 2rem;
}
.column {
  flex: 1;
}

label {
  display: flex;
  flex-direction: column;
  margin: 0.5rem 0;
}

#input-column select,
#input-column input,
#input-column textarea {
  width: 100%;
  max-width: 250px;
  padding: 0.25rem;
  margin-top: 0.25rem;
  font: inherit;
  color: #000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}
#input-column input[type="checkbox"] {
  width: auto;
  max-width: none;
  align-self: flex-start;
}

#clearBlackout {
  width: 80%;
  max-width: 200px;
  padding: 0.25rem;
  margin-top: 0.25rem;
  font: inherit;
  color: #fff;
  background: var(--theme-color);
  border: 1px solid var(--theme-color);
  border-radius: 6px;
  box-sizing: border-box;
}

.error {
  color: red;
  font-size: 0.9rem;
}

.message {
  color: green;
  font-size: 0.9rem;
}

#darkToggle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

body.dark #darkToggle {
  background: rgba(255,255,255,0.2);
}

input[type="checkbox"] {
  width: auto;
  accent-color: var(--theme-color);
}

label.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
}

.blurb {
  font-size: 0.9rem;
  color: #555;
}

#progressBarContainer {
  width: 100%;
  border: 1px solid #000;
  background: #fff;
  height: 20px;
  margin-top: 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}
#progressPrev,
#progressDelta {
  height: 100%;
}
#progressPrev {
  background: #4caf50;
  width: 0%;
  transition: width 200ms ease;
}
#progressDelta {
  background: #2196f3;
  width: 0%;
  transition: width 200ms ease;
}
#progressPercent {
  text-align: right;
  font-size: 0.9rem;
}

.csv-buttons {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

#snapshotBtn {
  margin-top: 0.5rem;
}


.hidden {
  display: none;
}

/* Outline tab */
/*
#outlineRoot {
  overflow-x: auto;
}
.outline-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.outline-columns {
  display: flex;
  gap: 1rem;
}
.outline-column {
  min-width: 180px;
  padding: 0.5rem;
  border-radius: 6px;
}
.outline-column textarea {
  width: 100%;
  height: 3rem;
  margin-bottom: 0.25rem;
  resize: vertical;
}
.outline-column.drag-over {
  outline: 2px dashed #666;
}

/* color coding for columns */
.col-0 {background:#e0f4f6;}
.col-1 {background:#d0e9ef;}
.col-2 {background:#c0dde8;}
.col-3 {background:#b0d2e1;}
.col-4 {background:#a0c6da;}

#outlineZoom {
  width:150px;
}
*/

/* Sprint tab */
.timer-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  margin:0 auto;
  width:100%;
}
#timerContainer {
  display:flex;
  justify-content:center;
  width:100%;
}
.timer-display {
  font-size:3rem;
  margin:1rem auto;
  border:1px solid #ccc;
  border-radius:4px;
}
#timerDisplay {
  display:inline-block;
  min-width:12ch;
  text-align:center;
  font-variant-numeric:tabular-nums;
}
.timer-buttons {
  display:flex;
  gap:0.5rem;
  justify-content:center;
  margin-bottom:1rem;
  flex-wrap:wrap;
}
.timer-buttons button {
  border:none;
  padding:0.75rem 1.25rem;
  border-radius:4px;
  cursor:pointer;
  min-width:80px;
}
.timer-buttons.actions button {
  background:var(--theme-color);
  color:#fff;
}
.timer-buttons.preset button {
  background:#ddd;
  color:#222;
}
#evaluateTab h2{
  text-align:center;
}
#evaluateTab .evaluate-blurb{
  text-align:center;
}
.mode-select{
  display:flex;
  justify-content:center;
  gap:1rem;
  margin:0.5rem 0;
}
.sprint-words{
  display:flex;
  flex-direction:column;
  align-items:center;
  margin-top:1rem;
}
.short-input{
  width:100%;
  max-width:120px;
  padding:0.25rem;
  margin-top:0.25rem;
  font:inherit;
  color:#000;
  background:#fff;
  border:1px solid #ccc;
  border-radius:6px;
  box-sizing:border-box;
}
#manualWhen{
  max-width:200px;
}
.manual-entry{
  display:flex;
  flex-wrap:wrap;
  gap:0.5rem;
  align-items:flex-end;
  margin-bottom:1rem;
  max-width:600px;
  margin-left:auto;
  margin-right:auto;
}
.manual-entry label{
  display:flex;
  flex-direction:column;
  flex:1 1 150px;
}

.log-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:0.5rem;
  justify-content:center;
  margin-bottom:1rem;
}
.sprint-log {
  margin-top:1rem;
  width:100%;
  border-collapse:collapse;
}
.sprint-log th,.sprint-log td {
  border:1px solid #ccc;
  padding:0.25rem;
  text-align:center;
}
.sprint-log tr.best-day{background:#fffbcc;color:#000;}

#guidesTab ul {
  list-style: none;
  padding-left: 0;
}
#guidesTab li {
  margin-bottom: 1rem;
}

.sprint-log tr.best-time{background:#e0f7fa;color:#000;}
.sprint-log tr.best-day.best-time{background:#e0ffe0;color:#000;}

.sprint-log th:first-child,
.sprint-log td:first-child {
  white-space: normal;
  word-break: break-word;
}

/* KPIs and plan table */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}
.kpi {
  background: var(--kpi-bg);
  border: 1px solid var(--theme-color);
  border-radius: 6px;
  padding: 0.5rem;
  text-align: center;
  width: 140px;
  justify-self: center;
}
.kpi-label {
  display: block;
  font-size: 0.75rem;
  color: #555;
}

body.dark .kpi-label {
  color: #bbb;
}
.kpi-value {
  font-size: 1.2rem;
  font-weight: 600;
}

@media (max-width: 480px) {
  .kpis {
    grid-template-columns: 1fr;
  }
  .kpi {
    width: 100%;
  }
}

#chartContainer {
  text-align: center;
  margin: 1rem auto;
}

#chartWrapper {
  position: relative;
  height: 40vh;
  width: 100%;
}

#chartWrapper canvas {
  max-width: 100%;
}


.plan-intro {
  text-align: center;
  margin-bottom: 1rem;
}

.guides-grid {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
}
.guides-grid li {
  margin: 0;
  flex: 1 1 calc(50% - 1rem);
}
.guides-grid li p {
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .guides-grid li {
    flex-basis: 100%;
  }
}

@media (max-width: 480px) {
  #chartWrapper { height: 35vh; }
}

@media (min-width: 768px) {
  #chartWrapper { height: 35vh; }
}


table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
th, td {
  border: 1px solid #ccc;
  padding: 0.25rem 0.4rem;
  text-align: right;
}
th:first-child, td:first-child {
  text-align: left;
  white-space: nowrap;
}


/* Outline */
/*
#outlineWrapper {
  position: relative;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  overflow: hidden;
  min-height: 420px;
}

#ol-columns {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 16px;
  overflow: auto;
  transform-origin: center;
}

#ol-columns.vertical {
  flex-direction: column;
  height: 70vh;
}

.ol-column {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 300px;
  background: var(--col-bg, hsl(210 60% 96%));
  border-radius: 10px;
  padding: 10px;
}

.ol-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.ol-col-title {
  width: 100%;
  font-weight: 600;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 4px 6px;
  background: #fff;
}

.ol-box {
  position: relative;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.ol-box textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border: none;
  outline: none;
  font: inherit;
}

.ol-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  margin-top: 6px;
}

.ol-control {
  align-self: center;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #9aa;
  background: #f5f8ff;
  cursor: pointer;
}

#ol-connectors {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
*/

.toolbar input[type="number"] {
  width: 120px;
}

.import-label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}

@media (max-width: 720px) {
  .ol-column {
    min-width: 260px;
  }
}
