.input-row {
  display: flex;
  flex-direction: row;
  width: 100%;
  margin-bottom: 8px;
  gap: 4px;
}
.input-row .course-code {
  flex: 3;
  margin-bottom: 0;
}
.input-row .section {
  flex: 2;
  margin-bottom: 0;
}
.input-row .add-course {
  display: none !important;
}
.routine-table,
.routine-table th,
.routine-table td,
.routine-table tr {
  color: var(--text) !important;
  background-color: transparent !important;
}
.routine-table {
  background-color: transparent !important;
  color: var(--text);
  border: 1px solid var(--border);
  border-collapse: collapse;
  width: 100%;
  font-size: 16px;
  border-radius: 12px;
  overflow: visible;
  margin-top: 8px;
}
.routine-table th,
.routine-table td {
  background-color: transparent !important;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  text-align: center;
  vertical-align: middle;
}
.routine-table th {
  font-weight: bold;
  background-color: var(--bg);
}
.routine-table tbody tr:last-child td {
  border-bottom: none;
}
#capture-area {
  margin-bottom: 50px;
}
#pdf-container canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 640px) {
  #pdf-container {
    padding: 0.5rem;
  }
  #pdf-container canvas {
    width: 100% !important;
    height: auto !important;
  }
}
.rounded::-webkit-scrollbar {
  display: none;
}
:where(
  .card-shadow,
  .badge,
  .btn,
  button,
  .dropdown,
  .custom-select .options,
  .site-logo,
  .routine-table,
  .routine-table th,
  .routine-table td,
  .page-row .course-code,
  .add-course,
  .badge-success,
  .copy-button
) {
  box-shadow: none !important;
  text-shadow: none !important;
}
.dropdown,
.custom-select .options {
  box-shadow: none !important;
}
:root {
  --radius-ui: 10px;
}
button,
.btn,
input,
select,
textarea,
.card-shadow,
.badge,
.site-logo,
.page-row .course-code,
.add-course,
.copy-button {
  border-radius: var(--radius-ui) !important;
}
.table-container {
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.table-container .routine-table {
  border: none;
  border-radius: 0;
}
#confirm-reset-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  z-index: 10010;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
#confirm-reset-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
#confirm-reset-dialog {
  background: var(--bg);
  color: var(--text);
  padding: 18px;
  max-width: 420px;
  width: calc(100% - 48px);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.04);
  text-align: center;
}
#confirm-reset-dialog h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
#confirm-reset-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
#confirm-reset-dialog .actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}
#confirm-reset-dialog .actions .btn {
  padding: 10px 14px;
  min-width: 110px;
  border-radius: 8px;
}
#confirm-reset-dialog .actions .btn-cancel {
  background: var(--primary);
  color: #fff;
  border: none;
  transition:
    background 0.12s,
    color 0.12s,
    transform 0.06s;
}
#confirm-reset-dialog .actions .btn-confirm {
  background: var(--danger, #ef4444);
  color: #fff;
  border: none;
  transition:
    filter 0.12s,
    transform 0.06s;
}
#confirm-reset-dialog .actions .btn-cancel:hover {
  background: var(--primary-600);
}
#confirm-reset-dialog .actions .btn-cancel:active {
  transform: translateY(1px);
}
#confirm-reset-dialog .actions .btn-cancel:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}
#confirm-reset-dialog .actions .btn-confirm:hover {
  filter: brightness(0.95);
}
#confirm-reset-dialog .actions .btn-confirm:active {
  transform: translateY(1px);
}
#confirm-reset-dialog .actions .btn-confirm:focus {
  outline: 3px solid rgba(239, 68, 68, 0.18);
  outline-offset: 2px;
}
@media (max-width: 420px) {
  #confirm-reset-dialog {
    padding: 14px;
  }
  #confirm-reset-dialog .actions {
    gap: 10px;
  }
  #confirm-reset-dialog .actions .btn {
    min-width: 90px;
    padding: 9px 12px;
  }
}

.install-label-no-style {
  color: inherit;
  text-decoration: none;
}

.dropdown {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}
.dropdown-option {
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
}
.dropdown-option.disabled {
  cursor: default;
  color: var(--muted);
}
.dropdown-option:hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary-600);
}

.dropdown .dropdown-option.active:not(.disabled),
.custom-select .options .option.active {
  background: var(--primary) !important;
  color: var(--surface) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04) inset;
}

.dropdown-list {
  max-height: none !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.dropdown-list.dropdown-list--limited {
  max-height: var(--dropdown-max-height) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
.dropdown-list.dropdown-list--hint {
  max-height: none !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: auto !important;
}
@media (prefers-reduced-motion: no-preference) {
  .dropdown-option,
  .dropdown-option.active {
    transition: background-color 120ms ease;
  }

  .summary-grid-max {
    max-height: 65vh;
  }
}

.routine-table tbody tr {
  position: relative;
}
.row-remove-btn {
  opacity: 1;
  transform: none;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background 120ms ease;
  background: transparent;
  border: 1px solid transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
}
.routine-table tbody tr:hover .row-remove-btn {
  transform: translateY(-1px);
}
.row-remove-btn:focus {
  outline: 3px solid rgba(var(--primary-rgb), 0.12);
  outline-offset: 2px;
}
.cell-with-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.routine-table th.w-8,
.routine-table td.w-8 {
  width: 48px;
  padding: 6px 8px;
}
.routine-table td .row-remove-btn.danger,
.row-remove-btn.danger {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--danger) !important;
  box-shadow: none !important;
  border-radius: 8px !important;
  width: auto !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 8px !important;
}
.export-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 8px;
}
.export-spinner.hidden {
  display: none !important;
}
.inline-logo {
  display: inline-block;
  vertical-align: middle;
}
.row-remove-btn.danger i,
.row-remove-btn.danger svg {
  color: var(--danger) !important;
  fill: var(--danger) !important;
}
.row-remove-btn.danger:hover {
  background: transparent !important;
  transform: translateY(-1px) !important;
}
.row-remove-btn.danger:active {
  transform: translateY(1px) !important;
}

.row-fade-out {
  animation: rowFadeOut 300ms ease forwards;
}
@keyframes rowFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
    height: 0;
    margin: 0;
    padding: 0;
  }
}

.row-fade-in {
  animation: rowFadeIn 240ms ease forwards;
}
@keyframes rowFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.undo-snackbar {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  padding: 8px 12px;
  z-index: 99999;
  display: flex;
  align-items: center;
}
.undo-snackbar.hidden {
  display: none;
}
.undo-content {
  display: flex;
  gap: 12px;
  align-items: center;
}
.undo-snackbar .btn-ghost {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 640px) {
  .row-remove-btn {
    opacity: 1 !important;
    transform: none !important;
  }
  .cell-with-controls {
    justify-content: space-between;
    gap: 6px;
  }
  .cell-with-controls .row-remove-btn {
    margin-left: 8px !important;
  }
}

#capture-area header {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  text-align: center !important;
}

#capture-area header .inline-logo {
  width: 64px !important;
  height: 64px !important;
  margin: 0 0 0.75rem 0 !important;
}

#capture-area header #schedule-title {
  margin: 0 !important;
}

#capture-area header.print-header {
  flex-direction: column !important;
}
