.page-content {
  max-width: 1500px;
}

@media (max-width: 600px) {
  .page-content {
    width: calc(100% - 12px);
    padding-left: 12px;
    padding-right: 12px;
  }
}

.upbo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  transition: opacity 0.15s ease-out;
}

.upbo-header h1 {
  color: var(--color-base-deep);
  margin: 0 0 4px;
}

.upbo-subtitle {
  color: var(--color-sub);
  margin: 0 0 4px;
}

.upbo-link {
  color: var(--color-base-deep);
  font-size: 0.85rem;
}

.upbo-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.upbo-danger-btn {
  color: #a83a4a;
  border-color: #a83a4a;
}

.upbo-danger-btn:hover {
  background: #a83a4a;
  color: #ffffff;
}

.upbo-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #f4e2e2;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.upbo-edit-fields label {
  font-size: 0.8rem;
  color: var(--color-sub);
  margin-top: 6px;
}

.upbo-edit-fields input {
  box-sizing: border-box;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-base);
  background: #ffffff;
  color: var(--color-text);
  font-family: 'Noto Sans KR', sans-serif;
}

.upbo-table-wrap {
  overflow-x: auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #f4e2e2;
  transition: opacity 0.15s ease-out;
}

/* Applied briefly by JS around a tab switch — fades the table (and the
   header above it) out, swaps content, then fades back in, instead of
   snapping to new content instantly. */
.upbo-table-wrap.view-fade,
.upbo-header.view-fade {
  opacity: 0;
}

.upbo-table {
  border-collapse: collapse;
  table-layout: auto;
  width: 100%;
  min-width: 100%;
}

.upbo-table td:not(.upbo-name-col),
.upbo-table th:not(.upbo-name-col) {
  min-width: 90px;
}

.upbo-table th,
.upbo-table td {
  border: 1px solid #f4e2e2;
  padding: 8px 10px;
  text-align: center;
  font-size: 0.85rem;
  white-space: nowrap;
}

.upbo-table thead th {
  background: #fdf1f1;
  color: var(--color-base-deep);
  position: sticky;
  top: 0;
}

.upbo-table .upbo-name-col {
  text-align: center;
  background: #fffbfb;
  font-weight: bold;
  position: sticky;
  left: 0;
  z-index: 1;
}

.upbo-table thead .upbo-name-col {
  z-index: 2;
  background: #fdf1f1;
}

.upbo-cell-input {
  box-sizing: border-box;
  width: auto;
  min-width: 70px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--color-base);
  font-family: 'Noto Sans KR', sans-serif;
  text-align: center;
}

.upbo-col-input {
  text-align: center;
  color: var(--color-base-deep);
}

.upbo-value-input {
  min-width: 60px;
}

.upbo-name-col,
.upbo-table th {
  white-space: nowrap;
}

.upbo-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background: #f8d7da;
  border: none;
  border-radius: 50%;
  color: #a83a4a;
  cursor: pointer;
  margin-left: 6px;
  font-size: 0.8rem;
  line-height: 1;
}

.upbo-remove-btn:hover {
  background: var(--color-base-deep);
  color: #ffffff;
}

.upbo-add-controls {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.upbo-import-sheet {
  margin-top: 18px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px dashed var(--color-base);
  border-radius: var(--radius-md);
}

.upbo-import-sheet label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-sub);
  margin-bottom: 8px;
}

.upbo-import-sheet-row {
  display: flex;
  gap: 8px;
}

.upbo-import-sheet-row input {
  flex: 1;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-base);
  background: #ffffff;
  color: var(--color-text);
  font-family: 'Noto Sans KR', sans-serif;
}

.upbo-import-sheet-hint {
  font-size: 0.75rem;
  color: var(--color-sub-light);
  margin: 8px 0 0;
}

.upbo-sheet-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.upbo-sheet-tab {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-base);
  background: #ffffff;
  color: var(--color-sub);
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.upbo-sheet-tab:hover,
.upbo-sheet-tab.active {
  background: var(--color-base);
  border-color: var(--color-base-deep);
  color: #ffffff;
}


.upbo-table td.upbo-clickable,
.upbo-table td.upbo-name-col.upbo-clickable {
  cursor: pointer;
}

.upbo-table td.upbo-clickable:hover {
  background: #fdf1f1;
}

.upbo-table tr.upbo-marker-row td {
  background: #fdf1f1;
  color: var(--color-base-deep);
  font-weight: bold;
  text-align: center;
  padding: 0;
}

.upbo-marker-sticky {
  position: sticky;
  left: 0;
  right: 0;
  width: fit-content;
  margin: 0 auto;
  padding: 8px 10px;
}

.upbo-cell-has-memo {
  position: relative;
}

/* Name column is already sticky (a positioned element), so keep that instead
   of letting the rule above downgrade it to plain relative positioning. */
.upbo-name-col.upbo-cell-has-memo {
  position: sticky;
  left: 0;
}

.upbo-done-check {
  margin-right: 6px;
  vertical-align: middle;
  cursor: pointer;
}

.upbo-cell-done {
  background: #e0e0e0 !important;
  color: #6b6b6b;
}

.upbo-cell-has-memo::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-base-deep);
}

.upbo-memo-value {
  color: var(--color-sub);
  font-size: 0.85rem;
  margin: 0 0 10px;
}

.upbo-memo-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-base);
  background: #ffffff;
  color: var(--color-text);
  font-family: 'Noto Sans KR', sans-serif;
  resize: vertical;
}

.upbo-memo-readonly {
  white-space: pre-wrap;
  color: var(--color-text);
  background: var(--color-bg, #fff9f8);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 60px;
}

.upbo-tooltip {
  position: fixed;
  z-index: 500;
  max-width: 260px;
  background: #ffffe1;
  border: 1px solid #c9c299;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  padding: 6px 10px;
  font-size: 0.8rem;
  color: #333333;
  white-space: pre-wrap;
  pointer-events: none;
  border-radius: 3px;
}
