/* Dash 8-400 style: red header, dark timeline, light content */
:root {
  --header-red: #B71C1C;
  --timeline-grey: #424242;
  --content-bg: #F5F5F5;
  --card-bg: #FFFFFF;
  --text-on-dark: #FFFFFF;
  --text-body: rgba(0, 0, 0, 0.87);
  --border-light: #E0E0E0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--content-bg);
  color: var(--text-body);
  min-height: 100vh;
}

.app-bar {
  background: var(--header-red);
  color: var(--text-on-dark);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.app-bar-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.app-bar-pill {
  padding: 5px 10px;
  border: 1px solid var(--text-on-dark);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

main {
  padding: 0 0 12px;
  max-width: 720px;
  margin: 0 auto;
}

.screen {
  padding: 0 10px;
}

.screen.hidden {
  display: none;
}

.hint {
  padding: 6px 4px 4px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-body);
  text-align: center;
}

.phase-list {
  padding: 4px 0;
}

.timeline-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 3px;
  min-height: 40px;
}

.timeline-offset {
  width: 48px;
  min-width: 48px;
  margin-right: 8px;
  background: var(--timeline-grey);
  color: var(--text-on-dark);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
}

.timeline-content {
  flex: 1;
  background: var(--card-bg);
  border-left: 1px solid var(--border-light);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.timeline-row.anchor .timeline-content {
  border-left-width: 3px;
  border-left-color: var(--header-red);
}

.timeline-label {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.3;
  min-width: 0;
}

.timeline-input {
  width: 72px;
  min-width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
}

.timeline-input:focus {
  outline: none;
  border-color: var(--header-red);
}

.actions {
  padding: 6px 0 0;
}

.btn-edit,
.btn-save {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  border: 2px solid var(--header-red);
  background: transparent;
  color: var(--header-red);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

.btn-edit:hover,
.btn-save:hover {
  background: rgba(183, 28, 28, 0.08);
}

.btn-save {
  background: var(--header-red);
  color: var(--text-on-dark);
  border-color: var(--header-red);
}

.btn-save:hover {
  background: #9B1515;
  border-color: #9B1515;
}

.edit-row .timeline-content {
  flex-wrap: wrap;
}

.edit-row .timeline-label {
  flex: 1 1 100%;
}

.edit-row .timeline-input-name {
  flex: 1;
  min-width: 110px;
  padding: 6px 8px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.85rem;
}

.edit-row .timeline-input-offset {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.85rem;
}

.edit-row .timeline-input-name:focus,
.edit-row .timeline-input-offset:focus {
  outline: none;
  border-color: var(--header-red);
}

.password-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.password-modal.hidden {
  display: none;
}

.password-modal-box {
  background: var(--card-bg);
  padding: 16px 20px;
  border-radius: 8px;
  min-width: 260px;
}

.password-modal-box label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.password-modal-box input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.9rem;
}

.password-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.password-modal-actions button {
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--content-bg);
}

.password-modal-actions button:last-child {
  background: var(--header-red);
  color: var(--text-on-dark);
  border-color: var(--header-red);
}
