/*
 * Compatibility baseline
 * ----------------------
 * This file intentionally uses conservative CSS and concrete color values.
 * It loads before styles.css, so modern browsers receive the full design while
 * managed/compatibility browsers still get a clean, usable layout.
 */

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #f4f6fa;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: #172033;
  background: #f4f6fa;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.auth-screen {
  min-height: 100vh;
  padding: 24px;
  background: #eef2fa;
  text-align: center;
}

.auth-card {
  width: 380px;
  max-width: 90%;
  margin: 50px auto;
  padding: 26px;
  background: #fff;
  border: 1px solid #dbe1eb;
  border-radius: 16px;
}

.auth-card .field,
.auth-card .button {
  display: block;
  width: 100%;
  margin-top: 12px;
  box-sizing: border-box;
}

body.is-authenticated .auth-screen,
body:not(.is-authenticated) .app-header,
body:not(.is-authenticated) .connection-banner,
body:not(.is-authenticated) .app-main {
  display: none;
}

body.is-history-view .focus-row,
body.is-history-view .support-sections {
  display: none;
}

.round-notes-panel {
  max-width: 1140px;
  margin: 28px auto 0;
  padding: 14px;
  background: #fffdf5;
  border: 1px solid #e9e1c5;
  border-radius: 10px;
}

.round-notes-heading,
.round-notes-footer,
.round-notes-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.round-notes-toolbar {
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 8px;
  background: #f5f1e6;
}

.round-notes-editor {
  width: 100%;
  min-height: 180px;
  margin-top: 8px;
  padding: 16px;
  box-sizing: border-box;
  background: white;
  border: 1px solid #d9d2bf;
}

.round-notes-footer {
  margin-top: 10px;
}

.round-notes-footer button {
  margin-right: auto;
}

button,
input,
textarea,
select {
  font-family: "Segoe UI", Arial, sans-serif;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.compatibility-banner {
  position: relative;
  z-index: 80;
  padding: 10px 18px;
  color: #68450a;
  background: #fff6de;
  border-bottom: 1px solid #eedaa5;
  text-align: center;
  font-size: 13px;
}

.compatibility-banner strong {
  display: block;
  margin-bottom: 2px;
  color: #593b08;
}

.app-header,
.brand,
.header-actions,
.focus-row,
.button,
.icon-button,
.add-button,
.panel-heading,
.section-heading,
.quick-add,
.day-header,
.home-toggle,
.day-actions,
.collapsible-panel > summary,
.person-add,
.person-heading,
.person-actions,
.trash-row,
.search-input-wrap,
.modal-header,
.modal-footer,
.field,
.field-row,
.toggle-field,
.attachments-heading,
.attachments-list,
.attachment-row,
.choice,
.history-summary,
.history-stats,
.toast-region,
.toast {
  display: -ms-flexbox;
  display: flex;
}

.app-header,
.brand,
.header-actions,
.button,
.icon-button,
.add-button,
.home-toggle,
.collapsible-panel > summary,
.person-heading,
.trash-row,
.search-input-wrap,
.modal-footer,
.toggle-field,
.attachments-heading,
.attachment-row,
.history-stats,
.toast {
  -ms-flex-align: center;
  align-items: center;
}

.app-header,
.panel-heading,
.section-heading,
.day-header {
  -ms-flex-pack: justify;
  justify-content: space-between;
}

.app-header {
  min-height: 76px;
  padding: 12px 46px;
  background: #fff;
  border-bottom: 1px solid #dbe1eb;
  box-shadow: 0 2px 20px rgba(29, 40, 65, 0.05);
}

.brand-mark {
  display: -ms-inline-flexbox;
  display: inline-flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: #315fdb;
  border-radius: 13px;
}

.button,
.icon-button,
.add-button {
  -ms-flex-pack: center;
  justify-content: center;
  min-height: 37px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.button-primary,
.add-button {
  color: #fff;
  background: #315fdb;
  border-color: #315fdb;
}

.button-secondary {
  color: #294eaa;
  background: #e8efff;
  border-color: #d7e2ff;
}

.button-quiet {
  color: #4e596d;
  background: transparent;
}

.button-danger-quiet {
  color: #bf4352;
  background: transparent;
}

.save-status {
  color: #697387;
}

.status-dot {
  background: #25866a;
}

.connection-banner {
  color: #744b0b;
  background: #fff6de;
}

.app-main {
  width: 94%;
  max-width: 1880px;
  margin: 0 auto;
  padding: 28px 0 64px;
}

.panel,
.day-card {
  background: #fff;
  border: 1px solid #e2e6ee;
  box-shadow: 0 1px 5px rgba(20, 29, 48, 0.07);
}

.panel {
  border-radius: 20px;
}

.panel-unassigned {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  min-width: 0;
  padding: 22px;
}

.focus-row {
  -ms-flex-align: start;
  align-items: flex-start;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto 32px;
}

.panel-today {
  -ms-flex: 0 1 520px;
  flex: 0 1 520px;
  min-height: 360px;
  margin-right: 14px;
  padding: 22px;
}

.panel-heading,
.section-heading {
  -ms-flex-align: end;
  align-items: flex-end;
}

.eyebrow,
.round-date:hover {
  color: #315fdb;
}

.panel-hint,
.section-heading p,
.round-date,
.day-date,
.task-subtitle,
.muted,
.attachment-row small,
.history-list-button small {
  color: #697387;
}

.count-badge {
  display: -ms-inline-flexbox;
  display: inline-flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  color: #5c6677;
  background: #eff1f5;
}

input,
textarea,
select {
  color: #172033;
  background: #fff;
  border: 1px solid #d4dbe7;
}

.quick-add input,
.quick-add textarea,
.person-card,
.trash-row,
.history-open-items,
.stat {
  background: #f8f9fc;
}

.quick-add > input,
.quick-add > textarea,
.person-add > input {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
}

.quick-add > .add-button {
  -ms-flex: 0 0 44px;
  flex: 0 0 44px;
}

.task-list,
.people-list,
.trash-list,
.search-results,
.history-content {
  min-height: 4px;
}

.task-card {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  min-height: 42px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e6ee;
  border-radius: 11px;
}

.task-check {
  -ms-flex: 0 0 25px;
  flex: 0 0 25px;
}

.task-main {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  min-width: 0;
}

.task-meta,
.task-menu-button {
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
}

.task-card.is-complete {
  background: #f8faf9;
}

.task-check input:checked + span {
  background: #25866a;
  border-color: #25866a;
}

.board-section {
  overflow-x: auto;
}

.days-board {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  min-width: 1540px;
}

.day-card {
  -ms-flex: 0 0 215px;
  flex: 0 0 215px;
  width: 215px;
  min-height: 242px;
  padding: 12px;
  border-radius: 14px;
}

.day-card.is-home,
.history-day.is-home {
  background: #e8ebf0;
}

.day-card .quick-add > .add-button {
  -ms-flex-basis: 34px;
  flex-basis: 34px;
}

.day-actions > button {
  -ms-flex: 1 1 0;
  flex: 1 1 0;
}

.support-sections {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
}

.summary-spacer,
.footer-spacer {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
}

.details-body {
  border-top: 1px solid #edf0f4;
}

.people-list {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

.person-card {
  -ms-flex: 1 1 300px;
  flex: 1 1 300px;
  padding: 12px;
  border: 1px solid #e2e6ee;
  border-radius: 12px;
}

.person-heading h3,
.trash-row > span,
.modal-header > div,
.history-summary > div:first-child,
.attachment-row a {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
}

.search-panel,
.modal {
  color: #172033;
  background: #fff;
  border: 1px solid #e2e6ee;
  box-shadow: 0 14px 38px rgba(25, 36, 60, 0.14);
}

.search-panel {
  width: 680px;
  max-width: 94%;
}

.modal {
  width: 620px;
  max-width: 94%;
  border-radius: 20px;
}

.modal-small {
  width: 480px;
}

.modal-wide {
  width: 1080px;
}

.field {
  -ms-flex: 1 1 0;
  flex: 1 1 0;
  -ms-flex-direction: column;
  flex-direction: column;
}

.attachments-section,
.modal-footer {
  border-color: #e2e6ee;
}

.attachments-list {
  -ms-flex-direction: column;
  flex-direction: column;
}

.choice {
  border: 1px solid #e2e6ee;
}

.history-layout {
  display: -ms-flexbox;
  display: flex;
}

.history-list {
  -ms-flex: 0 0 250px;
  flex: 0 0 250px;
  background: #f8f9fb;
  border-left: 1px solid #e2e6ee;
}

.history-content {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
}

.history-board {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  min-width: 850px;
}

.history-day {
  -ms-flex: 0 0 118px;
  flex: 0 0 118px;
  width: 118px;
  background: #fff;
  border: 1px solid #e2e6ee;
}

.history-completed {
  background: #e9f7f2;
}

.toast-region {
  -ms-flex-direction: column;
  flex-direction: column;
}

@media (max-width: 900px) {
  .app-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .app-main {
    width: auto;
    margin-right: 14px;
    margin-left: 14px;
  }

  .focus-row {
    display: block;
  }

  .panel-today {
    margin-top: 14px;
    margin-right: 0;
  }
}

@media (max-width: 620px) {
  .field-row,
  .history-layout {
    display: block;
  }

  .history-list {
    width: auto;
    border-left: 0;
  }
}

/*
 * These stronger rules activate only when compat.js confirms that the modern
 * stylesheet or required browser features are unavailable.
 */

.compatibility-mode *,
.compatibility-mode *::before,
.compatibility-mode *::after {
  box-sizing: border-box;
}

.compatibility-mode .brand h1 {
  margin: 0;
  font-size: 20px;
}

.compatibility-mode .round-date {
  display: block;
  margin-top: 2px;
  padding: 0;
  color: #697387;
  background: transparent;
  border: 0;
  font-size: 12px;
}

.compatibility-mode .header-actions {
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

.compatibility-mode .header-actions > * {
  margin: 4px;
}

.compatibility-mode h2 {
  margin: 2px 0 0;
  font-size: 19px;
}

.compatibility-mode .panel-heading,
.compatibility-mode .section-heading {
  margin-bottom: 14px;
}

.compatibility-mode .panel-heading > *,
.compatibility-mode .section-heading > * {
  margin-left: 16px;
}

.compatibility-mode .quick-add {
  width: 100%;
  margin-bottom: 12px;
}

.compatibility-mode .quick-add input,
.compatibility-mode .quick-add textarea,
.compatibility-mode .person-add input {
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 9px;
}

.compatibility-mode .quick-add > .add-button {
  margin-right: 8px;
}

.compatibility-mode .empty-state {
  padding: 14px 8px;
  color: #929bad;
  text-align: center;
}

.compatibility-mode .days-board {
  -ms-flex-align: start;
  align-items: flex-start;
  padding: 2px;
}

.compatibility-mode .day-card {
  -ms-flex: 0 0 calc(14.285714% - 10px);
  flex: 0 0 calc(14.285714% - 10px);
  width: calc(14.285714% - 10px);
  margin: 5px;
}

.compatibility-mode .day-name {
  margin: 0;
  font-size: 14px;
}

.compatibility-mode .day-date {
  display: block;
  margin-top: 2px;
}

.compatibility-mode .day-card .quick-add input,
.compatibility-mode .day-card .quick-add textarea {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}

.compatibility-mode .day-card .add-button {
  min-height: 34px;
  padding: 0;
}

.compatibility-mode .day-empty {
  min-height: 58px;
  padding: 8px;
  color: #929bad;
  border: 1px dashed #e1e5eb;
  border-radius: 9px;
  text-align: center;
  font-size: 11px;
}

.compatibility-mode .day-actions > button {
  margin-left: 5px;
}

.compatibility-mode .collapsible-panel > summary {
  min-height: 58px;
  padding: 12px 17px;
}

.compatibility-mode .collapsible-panel > summary > * {
  margin-left: 8px;
}

.compatibility-mode .details-body {
  padding: 14px 17px 17px;
}

.compatibility-mode .support-sections > .panel {
  margin-bottom: 10px;
}

.compatibility-mode .person-card {
  margin: 5px;
}

.compatibility-mode .task-title,
.compatibility-mode .task-subtitle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compatibility-mode .task-main {
  margin: 0 5px;
  padding: 2px 3px;
  background: transparent;
  border: 0;
  text-align: right;
}

.compatibility-mode .task-menu-button {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
}

.compatibility-mode .history-day {
  margin: 3px;
}
