:root {
  --canvas: #FFFFFF;
  --ink: #111111;
  --rule: #111111;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; }
input { font-family: inherit; }

.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 14px 20px 40px;
}

.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 42px;
  line-height: 1;
  text-align: center;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  color: var(--ink);
}

/* ============ BOARD ============ */
/* Layout: [row-label col] [quad col] [quad col]
           [spacer row]   [col-label]  [col-label]
           [quad row]     [Q1]         [Q2]
           [quad row]     [Q3]         [Q4]
   Using explicit positions to keep the 2x2 solid at any width. */
.board {
  display: grid;
  grid-template-columns: 64px 1fr 1fr;
  grid-template-rows: 22px 1fr 1fr;
  column-gap: 0;
  row-gap: 0;
  position: relative;
  min-height: 680px;
}

.col-label {
  grid-row: 1;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: var(--ink);
  align-self: end;
  padding-bottom: 6px;
}
.col-1 { grid-column: 2; }
.col-2 { grid-column: 3; }

.row-label {
  grid-column: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 10px;
}
.row-1 { grid-row: 2; }
.row-2 { grid-row: 3; }

/* Cross axis lines */
.axis-v {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  position: relative;
  pointer-events: none;
}
.axis-v::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px; background: var(--rule);
  transform: translateX(-50%);
  z-index: 3;
}
.axis-h {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  position: relative;
  pointer-events: none;
}
.axis-h::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 2px; background: var(--rule);
  transform: translateY(-50%);
  z-index: 3;
}

.cell { min-height: 0; min-width: 0; }
.cell-q1 { grid-column: 2; grid-row: 2; padding: 0 10px 10px 0; }
.cell-q2 { grid-column: 3; grid-row: 2; padding: 0 0 10px 10px; }
.cell-q3 { grid-column: 2; grid-row: 3; padding: 10px 10px 0 0; }
.cell-q4 { grid-column: 3; grid-row: 3; padding: 10px 0 0 10px; }

/* ============ QUADRANT ============ */
.quadrant {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 2px;
  min-height: 0;
  min-width: 0;
}

.drop-overlay {
  position: absolute;
  inset: 4px;
  border: 2px dashed;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0.7;
  z-index: 2;
}

.q-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  color: inherit;
  margin-bottom: 2px;
}

/* ============ TASK LIST ============ */
.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
}
.task-list::-webkit-scrollbar { width: 5px; }
.task-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }

.task {
  display: grid;
  grid-template-columns: 10px auto 1fr auto;
  align-items: start;
  column-gap: 8px;
  padding: 3px 2px;
  cursor: grab;
  transition: opacity 150ms;
  min-width: 0;
}
.task:active { cursor: grabbing; }
.task.dragging { opacity: 0.4; }
.task.done .task-title { text-decoration: line-through; opacity: 0.55; }

.bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 3px;
  opacity: 0.95;
}

.check {
  width: 15px;
  height: 15px;
  border: 1.5px solid;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 140ms, background 140ms;
}
.check:hover { opacity: 1; background: rgba(255,255,255,0.2); }
.quadrant[style*="F6B93B"] .check:hover { background: rgba(0,0,0,0.08); }

.task-title {
  font-size: 14px;
  line-height: 1.4;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  font-weight: 500;
  text-align: left;
}

.task-input {
  font-size: 14px;
  line-height: 1.35;
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  padding: 0 0 1px 0;
  border-bottom: 1px dashed currentColor;
  font-weight: 500;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 140ms;
  flex-shrink: 0;
}
.task:hover .task-actions,
.task:focus-within .task-actions { opacity: 1; }

.priority-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  line-height: 1.4;
}
.task:not(:hover) .priority-chip { opacity: 0.6; }
.priority-chip:hover { background: rgba(255,255,255,0.22); }
.quadrant[style*="F6B93B"] .priority-chip:hover { background: rgba(0,0,0,0.08); }

.priority-input {
  width: 52px;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 999px;
  background: transparent;
  outline: none;
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-weight: 700;
}

.icon-btn {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  opacity: 0.7;
  transition: opacity 140ms, background 140ms;
}
.icon-btn:hover { opacity: 1; background: rgba(255,255,255,0.22); }
.quadrant[style*="F6B93B"] .icon-btn:hover { background: rgba(0,0,0,0.08); }

/* ============ ADD TASK ============ */
.add-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 0;
  border-top: 1px dashed;
  opacity: 0.85;
  margin-top: 6px;
  flex-shrink: 0;
}
.add-plus { font-size: 15px; line-height: 1; opacity: 0.7; font-weight: 300; }
.add-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  padding: 2px 0;
  font-weight: 500;
  min-width: 0;
}
.add-input::placeholder { color: currentColor; opacity: 0.5; }

/* ============ FOOTER ============ */
.hint {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #11111199;
  margin-top: 20px;
  font-weight: 500;
}
.dot-sep { opacity: 0.4; }

/* ============ OPTION A — slim navbar header ============ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px 0;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 10px;
}
.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.user-email {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}
.signout-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border: 1.5px solid #111;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  color: #111;
  transition: background 140ms;
}
.signout-btn:hover { background: #f0f0f0; }

/* ============ LOGIN SCREEN ============ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
}
.login-card {
  text-align: center;
  padding: 48px 40px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  max-width: 400px;
  width: 100%;
}
.login-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 32px;
  margin: 0 0 8px;
}
.login-sub {
  font-size: 14px;
  color: #666;
  margin: 0 0 32px;
}
.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  border: 1.5px solid #dadce0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: #111;
  transition: box-shadow 140ms, background 140ms;
}
.google-btn:hover:not(:disabled) { background: #f8f8f8; box-shadow: 0 1px 6px rgba(0,0,0,0.12); }
.google-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error { color: #E55B50; font-size: 13px; margin-top: 16px; }

/* ============ LOADING ============ */
.loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #888;
}

/* Only collapse to a single column on truly narrow screens */
@media (max-width: 560px) {
  .page-title { font-size: 30px; }
  .board {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }
  .col-label, .row-label, .axis-v, .axis-h { display: none; }
  .cell { grid-column: 1 !important; padding: 6px 0 !important; }
  .cell-q1 { grid-row: 1; }
  .cell-q2 { grid-row: 2; }
  .cell-q3 { grid-row: 3; }
  .cell-q4 { grid-row: 4; }
  .quadrant { min-height: 180px; }
}
