/* Excel replica — ribbon visuals: tab strip, groups, controls, galleries,
 * dropdown panels, color palettes. Office "Colorful" theme. */
#tabstrip {
  height: 26px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, var(--xl-green) 0%, #1e6a41 100%);
  padding: 0 4px;
  gap: 0;
}
.tab {
  height: 22px; padding: 0 12px 2px;
  display: inline-flex; align-items: center;
  font-size: 12px; letter-spacing: .15px;
  color: #eaf4ec; cursor: pointer;
  border-radius: 3px 3px 0 0;
  position: relative;
}
.tab:hover { background: rgba(255,255,255,.13); }
.tab.active {
  background: var(--ribbon-tab-active);
  color: #1b5e38;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--xl-green);
}
#tabstrip .file-tab { margin-right: 6px; }

#ribbonBody {
  min-height: 92px;
  background: var(--ribbon-bg);
  display: none;
  padding: 2px 6px 4px;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
#ribbonArea.open #ribbonBody { display: flex; }

.rb-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 7px;
  border-right: 1px solid #dcd9d6;
  min-width: max-content;
}
.rb-group-label {
  text-align: center; color: #79756f; font-size: 11px;
  margin-top: 1px; user-select: none;
}
.rb-controls { display: flex; align-items: center; gap: 2px; flex: 1; }
.rb-controls.col { flex-direction: column; align-items: stretch; gap: 1px; }
.rb-row { display: flex; align-items: center; gap: 2px; }

/* buttons */
.rb-btn {
  min-width: 24px; height: 24px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  border-radius: 2px; padding: 0 3px; color: #444;
  font-family: inherit;
}
.rb-btn:hover:not(.disabled) { background: #fff8; border-color: #cfcac5; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.rb-btn.pressed:not(.disabled), .rb-btn.on:not(.disabled) { background: #dfece3; border-color: #a9c7b4; box-shadow: inset 0 1px 2px rgba(33,115,70,.25); }
.rb-btn.disabled { opacity: .4; cursor: default; }
.rb-btn .lbl { font-size: 10px; margin-top: -1px; white-space: nowrap; }
.rb-btn.big { width: auto; min-width: 46px; height: 62px; }
.rb-btn.split::after {
  content: ""; width: 0; height: 0;
  border-left: 3.2px solid transparent; border-right: 3.2px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 2px; opacity: .75;
}

/* compact font controls */
.rb-select {
  height: 21px; border: 1px solid #c7c3bd; border-radius: 2px;
  font-family: inherit; font-size: 12px; background: #fff; color: #333;
  outline: none;
}
.rb-select:focus { border-color: var(--xl-green); }
.rb-num { width: 52px; text-align: left; padding-left: 5px; }
.rb-font { width: 118px; padding-left: 5px; }

/* gallery (cell styles / formats) */
.gallery {
  height: 64px;
  border: 1px solid #ccc; border-radius: 3px;
  overflow-y: auto; overflow-x: hidden; background: #fff;
  scrollbar-width: thin;
  flex: 1;
}
.gal-row { display: grid; grid-template-columns: repeat(2, minmax(96px,1fr)); }
.gal-item {
  display: flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 5px; cursor: pointer;
  font-family: var(--cell-font);
  border-bottom: 1px solid #f2f0ee;
}
.gal-item:hover { background: #dfece3; outline: 1px solid var(--xl-green); }
.gal-item .swatch {
  width: 26px; height: 14px; flex: none;
  display:inline-flex;align-items:center;justify-content:center;font-size:8px;color:#666;
  border: 1px solid #ddd; background:#fafafa;
}
.gal-item .swatch b { background:#21734633; border:1px solid #88aa98; width:16px;height:10px;}

/* dropdown / palettes trigger arrows inside controls */
.ddbtn-arrow { font-size: 8px; line-height: 1; opacity: .8; margin-left: 2px; }
.with-dd { display: inline-flex; align-items: center; }
.mini-split { display: inline-flex; border-radius: 2px; overflow: visible; }
.mini-split .main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.mini-split .arr {
  border: 1px solid transparent; background: transparent; cursor: pointer;
  width: 15px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0 2px 2px 0;
}
.mini-split:hover .arr { background: #fff8; border-color: #cfcac5; }
.mini-split .arr:hover { background: #efe; border-color: #a9c7b4; }

/* palette popup grids live in overlays.css but colors here for reference:
   accent row mirrors Excel's standard theme palette order */

/* dialog launcher corner */
.rb-launcher {
  position: absolute;
}
.rb-group { position: relative; }
.rb-group > .launcher {
  position: absolute; right: 2px; bottom: 12px;
  width: 13px; height: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; color: #8a867f;
  border-radius: 2px;
}
.rb-group > .launcher:hover { background: #fff; box-shadow: 0 0 0 1px #cfcac5; }
