/* Responsive refinements; original brand and desktop layout are retained. */
aside { top: 0; }
#sync-status { position: sticky; top: 0; z-index: 15; padding: 8px 20px; margin-left: 218px; background: #203c32; color: #90ddb2; font-size: 12px; }
#sync-status.sync-error { background: #442d23; color: #ffb486; }
@media (max-width: 900px) and (min-width: 701px) { #sync-status { margin-left: 190px; } }
@media (max-width: 700px) { #sync-status { margin-left: 0; } }
:root {
  --accent: #8777ec;
  --background: #0e1015;
  --surface: #191d26;
}
body {
  min-width: 320px;
}
main,
.detail-grid > div,
.calendar-layout > section {
  min-width: 0;
}
h1,
h2,
.log {
  overflow-wrap: anywhere;
}
.cover b {
  display: block;
  max-width: calc(100% - 24px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mobile-nav {
  display: none;
}
.toast {
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.detail-grid table {
  display: block;
  overflow-x: auto;
}
.detail-grid td:first-child {
  min-width: 145px;
}
.project-table {
  max-width: 100%;
}
button,
.nav {
  touch-action: manipulation;
}
@media (min-width: 701px) and (max-width: 900px) {
  aside {
    width: 190px;
    padding: 24px 16px;
  }
  main {
    margin-left: 190px;
    padding: 24px 20px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
  header {
    flex-wrap: wrap;
    gap: 14px;
  }
}
@media (max-width: 700px) {
  main {
    padding: 20px 16px 100px;
  }
  h1 {
    font-size: 23px;
    line-height: 1.4;
  }
  header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
  }
  header > .primary {
    width: 100%;
  }
  .stats {
    gap: 10px;
    margin: 18px 0 24px;
  }
  .stat {
    padding: 17px;
  }
  .stat strong {
    font-size: 29px;
  }
  .categories {
    gap: 7px;
  }
  .categories button {
    padding: 10px 12px;
  }
  .toolbar {
    gap: 9px;
  }
  .toolbar > select {
    flex: 1;
    max-width: 100%;
  }
  .toolbar > button {
    flex: 1;
  }
  .view-switch {
    width: 100%;
  }
  .view-switch button {
    flex: 1;
  }
  .panel {
    padding: 17px;
  }
  .calendar-panel {
    padding: 0;
  }
  .calendar-head {
    flex-wrap: wrap;
  }
  .month-cell {
    min-height: 66px;
  }
  .detail-actions button {
    flex: 1;
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    z-index: 10;
    bottom: 0;
    left: 0;
    right: 0;
    gap: 6px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: #14171ef5;
    border-top: 1px solid #353c4c;
  }
  .mobile-nav button {
    flex: 1;
    min-height: 44px;
    padding: 10px 5px;
    border-color: transparent;
    background: transparent;
    font-size: 13px;
  }
  .mobile-nav button.active {
    background: #302a47;
    color: #d6ccff;
  }
  .toast {
    bottom: 86px;
    z-index: 20;
  }
  .modified-time {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
