/* ===== Excel 창 내부 ===== */
.xl-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}

/* ===== 리본 ===== */
.xl-ribbon {
  flex: 0 0 auto;
  background: #f3f3f3;
  border-bottom: 1px solid #d6d6d6;
}

.xl-ribbon-tabs {
  display: flex;
  align-items: flex-end;
  height: 28px;
  padding-left: 4px;
  background: var(--xl-green);
  font-size: 12px;
}

.win:not(.is-active) .xl-ribbon-tabs {
  background: #3f8a63;
}

.xl-ribbon-tab {
  padding: 0 12px;
  height: 24px;
  line-height: 24px;
  color: #fff;
  border-radius: 3px 3px 0 0;
}

.xl-ribbon-tab-file {
  font-weight: 600;
}

.xl-ribbon-tab.is-active {
  background: #f3f3f3;
  color: #222;
}

.xl-ribbon-body {
  display: flex;
  height: 72px;
  padding: 4px 8px 0;
  gap: 4px;
}

.xl-ribbon-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 10px;
  border-right: 1px solid #dcdcdc;
  color: #333;
}

.xl-ribbon-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.xl-font-name,
.xl-font-size {
  display: inline-block;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid #c8c8c8;
  font-size: 12px;
}

.xl-font-name { width: 120px; }
.xl-font-size { width: 44px; }

.xl-fmt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 12px;
  color: #333;
}

.xl-ribbon-group-label {
  font-size: 11px;
  color: #666;
  text-align: center;
  padding-bottom: 2px;
}

@media (max-width: 720px) {
  .xl-ribbon-body { display: none; }
}

/* ===== 이름 상자 / 수식 입력줄 ===== */
.xl-formula-row {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  height: 26px;
  border-bottom: 1px solid #d6d6d6;
  background: #fff;
}

.xl-namebox {
  width: 100px;
  border: none;
  border-right: 1px solid #d6d6d6;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  outline: none;
  background: #fff;
  color: #000;
}

.xl-fx {
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  color: #555;
  border-right: 1px solid #d6d6d6;
  font-size: 12px;
}

.xl-formula {
  flex: 1 1 auto;
  border: none;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  outline: none;
  background: #fff;
  color: #000;
}

/* ===== 셀 그리드 ===== */
.xl-grid-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
  outline: none;
  position: relative;
}

.xl-grid {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
}

.xl-grid th,
.xl-grid td {
  height: 22px;
  padding: 0 4px;
  border-right: 1px solid var(--xl-grid-line);
  border-bottom: 1px solid var(--xl-grid-line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  line-height: 20px;
}

.xl-grid th {
  position: sticky;
  background: var(--xl-header-bg);
  color: var(--xl-header-text);
  font-weight: 400;
  text-align: center;
  z-index: 2;
}

.xl-grid thead th {
  top: 0;
  border-top: none;
}

.xl-grid tbody th {
  left: 0;
  width: 42px;
  z-index: 1;
}

.xl-grid th.xl-corner {
  left: 0;
  top: 0;
  z-index: 3;
  width: 42px;
}

.xl-grid th.is-highlight {
  background: var(--xl-select-header-bg);
  color: var(--xl-green-dark);
}

.xl-grid thead th.is-highlight {
  border-bottom: 2px solid var(--xl-green);
}

.xl-grid tbody th.is-highlight {
  border-right: 2px solid var(--xl-green);
}

.xl-grid td {
  cursor: cell;
  background: #fff;
  position: relative;
}

.xl-grid td.is-selected {
  outline: 2px solid var(--xl-select);
  outline-offset: -2px;
  z-index: 1;
}

.xl-grid td.xl-bold { font-weight: 700; }
.xl-grid td.xl-align-center { text-align: center; }
.xl-grid td.xl-align-right { text-align: right; }
.xl-grid td.xl-num { text-align: right; }

/* ===== 시트 탭 ===== */
.xl-sheetbar {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  height: 26px;
  background: #f3f3f3;
  border-top: 1px solid #d6d6d6;
}

.xl-sheet-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: #888;
  font-size: 11px;
  border-right: 1px solid #d6d6d6;
}

.xl-sheet-tabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.xl-sheet-tabs::-webkit-scrollbar { display: none; }

.xl-sheet-tab {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-right: 1px solid #d6d6d6;
  color: #333;
  font-size: 12px;
  white-space: nowrap;
  cursor: default;
}

.xl-sheet-tab:hover {
  background: #e6e6e6;
}

.xl-sheet-tab.is-active {
  background: #fff;
  color: var(--xl-green);
  font-weight: 700;
  border-bottom: 2px solid var(--xl-green);
  margin-top: -1px;
}

.xl-sheet-tab.is-locked {
  color: #777;
  font-style: italic;
}

.xl-sheet-lock {
  margin-left: 5px;
  font-size: 10px;
  font-style: normal;
}

/* ===== 상태 표시줄 ===== */
.xl-statusbar {
  flex: 0 0 auto;
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--xl-green);
  color: #fff;
  font-size: 11px;
}

.win:not(.is-active) .xl-statusbar {
  background: #3f8a63;
}

/* 숨기기 한 시트 (hidden: "plain") */
.xl-sheet-tab.is-hidden-sheet { font-style: italic; color: #888; }
