/* 图表设置弹窗：布局对齐官方 Terminal 的 Settings 面板。 */

.work-gear {
  margin-left: auto;
  width: 30px;
  height: 26px;
  padding: 0;
  border: 1px solid #e6e8eb;
  border-radius: 6px;
  background: #fff;
  color: #4b5563;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.work-gear:hover {
  background: #f4f5f7;
  color: #111827;
}

/* 图表工具栏：周期按钮靠左，齿轮靠右 */
.work-chart-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.cs-open {
  overflow: hidden;
}

.cs-host {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.32);
}

.cs-modal {
  position: relative;
  width: 620px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.24);
  font-family: "Groww Sans", Arial, sans-serif;
  color: #1f2430;
}

.cs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
}

.cs-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.cs-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cs-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.cs-main {
  display: flex;
  flex: 1;
  min-height: 320px;
  border-top: 1px solid #eceef0;
}

.cs-tabs {
  width: 208px;
  flex: 0 0 208px;
  padding: 10px 0;
  background: #fafbfc;
  border-right: 1px solid #eceef0;
  display: flex;
  flex-direction: column;
}

.cs-tab {
  padding: 9px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  color: #3f4652;
  cursor: pointer;
}

.cs-tab:hover {
  background: #f2f4f6;
}

.cs-tab.active {
  background: #edeff2;
  color: #111827;
  font-weight: 600;
}

.cs-panel {
  flex: 1;
  padding: 16px 22px 20px;
  overflow-y: auto;
}

.cs-group {
  margin: 4px 0 12px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa0ac;
}

.cs-group:not(:first-child) {
  margin-top: 22px;
  border-top: 1px solid #f0f1f3;
  padding-top: 16px;
}

.cs-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  font-size: 13.5px;
  color: #2b313c;
  cursor: pointer;
}

.cs-check input {
  width: 15px;
  height: 15px;
  accent-color: #5367ff;
  cursor: pointer;
}

.cs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: #2b313c;
}

.cs-row > span {
  min-width: 92px;
}

.cs-swatches {
  display: flex;
  gap: 8px;
}

.cs-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  font-size: 12.5px;
  color: #6b7280;
  cursor: pointer;
}

.cs-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #5367ff;
  cursor: pointer;
}

.cs-swatch {
  display: block;
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid #e3e5e9;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
}

.cs-swatch input[type="color"] {
  width: 150%;
  height: 150%;
  margin: -25%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.cs-row select {
  min-width: 178px;
  padding: 6px 8px;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #1f2430;
}

.cs-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid #eceef0;
}

.cs-template {
  padding: 8px 14px;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #3f4652;
  cursor: pointer;
}

.cs-template:hover {
  background: #f4f5f7;
}

.cs-actions {
  display: flex;
  gap: 10px;
}

.cs-cancel,
.cs-ok {
  min-width: 82px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  cursor: pointer;
}

.cs-cancel {
  border: 1px solid #dcdfe4;
  background: #fff;
  color: #2b313c;
}

.cs-cancel:hover {
  background: #f4f5f7;
}

.cs-ok {
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
}

.cs-ok:hover {
  background: #000;
}

@container groww-app (max-width: 640px){
  .cs-modal {
    width: 100%;
  }
  .cs-main {
    flex-direction: column;
  }
  .cs-tabs {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #eceef0;
    padding: 6px 8px;
  }
  .cs-tab {
    white-space: nowrap;
    border-radius: 6px;
  }
}
