.top-calendar-tool {
  --tc-date-width: 86px;
  --tc-event-width: 136px;
  --tc-header-height: 32px;
  --tc-row-height: 78px;
  --tc-gap: 6px;
  color: #222;
}

.tc-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  max-width: 1160px;
  margin-bottom: 18px;
}

.tc-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.tc-header p {
  max-width: 780px;
  margin: 0;
  line-height: 1.6;
  color: #555;
}

.tc-file-note {
  min-width: 270px;
  padding: 10px 12px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  background: #fafafa;
  font-size: 12px;
  line-height: 1.5;
}

.tc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  max-width: 1160px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #f8f9fa;
}

.tc-toolbar label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.tc-toolbar input[type="number"] {
  width: 88px;
  margin-top: 4px;
}

.tc-status {
  max-width: 1160px;
  min-height: 42px;
  padding: 10px 12px;
  margin-bottom: 18px;
  border-left: 5px solid #0c1461;
  background: #f2f5ff;
  line-height: 1.5;
}

.tc-status.is-warning {
  border-color: #b7791f;
  background: #fff8e5;
}

.tc-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  max-width: 1160px;
  margin-bottom: 8px;
}

.tc-title-row h3,
.tc-section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.tc-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.tc-sample {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 8px;
  border: 2px solid transparent;
}

.tc-normal {
  border-color: #0c1461;
  color: #0c1461;
}

.tc-cutoff-noon {
  color: #0c1461;
}

.tc-up {
  border-color: #db1280;
  color: #db1280;
}

.tc-cutoff-morning {
  color: #db1280;
}

.tc-calendar-scroll {
  position: relative;
  max-width: 1160px;
  overflow-x: auto;
  padding: 0 0 12px;
  background: #fff;
  scrollbar-gutter: stable;
}

.tc-calendar-grid {
  display: grid;
  gap: var(--tc-gap) !important;
  column-gap: var(--tc-gap) !important;
  row-gap: var(--tc-gap) !important;
  align-items: stretch;
  position: relative;
  isolation: isolate;
  max-height: 180px;
}

.tc-corner,
.tc-date-head,
.tc-event-head,
.tc-day-cell {
  box-sizing: border-box;
}

.tc-corner {
  min-width: var(--tc-event-width);
  position: sticky;
  left: 0;
  z-index: 6;
  background: #fff;
}

.tc-date-head {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100% !important;
  max-width: none;
  min-width: 0;
  justify-self: stretch;
  margin: 0 !important;
  height: var(--tc-header-height);
  padding: 5px 2px;
  overflow: hidden;
  border-radius: 6px;
  background: #d9d9d9;
  box-shadow: 0 2px 2px rgba(0, 0, 0, .34);
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

.tc-date-head.tc-closed-day {
  background: #ffe3eb;
  color: #aa034c;
  box-shadow: inset 0 0 0 2px rgba(219, 18, 128, .18), 0 2px 2px rgba(0, 0, 0, .28);
}

.tc-date-head.tc-month-start {
  box-shadow: inset 1px 0 0 #c8c8c8, 0 2px 2px rgba(0, 0, 0, .28);
}

.tc-event-head {
  position: sticky;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: var(--tc-event-width);
  height: var(--tc-row-height);
  max-width: 116px;
  padding: 7px 8px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid #e7db9a;
  background: #fffdf0;
  box-shadow: 2px 2px 3px rgba(0, 0, 0, .24);
  color: #004fac;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.18;
  isolation: isolate;
}

.tc-calendar-grid > .tc-event-head,
.tc-calendar-grid > .tc-corner {
  position: sticky;
  left: 0;
}

.tc-calendar-grid > .tc-event-head {
  z-index: 20;
}

.tc-event-head::after,
.tc-corner::after {
  content: "";
  position: absolute;
  top: -2px;
  right: calc(-1 * var(--tc-gap) - 7px);
  bottom: -2px;
  width: calc(var(--tc-gap) + 8px);
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
}

.tc-event-date {
  display: block;
  flex: 0 0 auto;
}

.tc-event-name {
  display: contents;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  letter-spacing: -0.2px;
}

.tc-event-head small {
  display: block;
  flex: 0 0 auto;
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #005bbb;
  font-size: 11px;
  font-weight: 700;
}

.tc-day-cell {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--tc-row-height);
  min-height: 60px;
  overflow: hidden;
  border-radius: 6px;
  background: #fffdf2;
  box-shadow: inset 0 0 0 1px #eee4d3;
}

.tc-row-even {
  background: #fbf4ed;
}

.tc-day-cell:empty {
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px #f0e8dc;
}

.tc-day-cell.tc-row-even:empty {
  background: #fbf6ef;
}

.tc-day-cell.tc-closed-day:empty {
  background: #fff5f8;
}

.tc-day-cell.tc-closed-day {
  background: #fff0f5;
  box-shadow: inset 0 0 0 1px #f4cfde;
}

.tc-day-cell.tc-month-start {
  box-shadow: inset 1px 0 0 #ddd3c5, inset 0 0 0 1px #e6dfd2;
}

.tc-day-cell.tc-cutoff-past {
  opacity: 1;
}

.tc-day-cell.tc-cutoff-past .tc-cell-box {
  opacity: .3;
}

.tc-day-cell.tc-cutoff-today {
  box-shadow: inset 0 0 0 2px rgba(219, 18, 128, .38), inset 0 0 0 1px #e6dfd2;
}

.tc-cell-box {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px currentColor;
  text-align: center;
  font-weight: 800;
  line-height: 1.08;
}

.tc-box-label {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
  letter-spacing: 0;
}

.tc-box-main {
  display: block;
  font-size: 20px;
  font-weight: 900;
}

.tc-box-part {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.tc-box-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  height: 100%;
}

.tc-box-split {
  border-radius: 6px;
}

.tc-box-stack span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
}

.tc-box-stack span:first-child {
  border-bottom: 2px solid rgba(255, 255, 255, .72);
}

.tc-kind-event {
  background: #12683f;
  color: #fff;
  font-size: 17px;
  line-height: 1.45;
}

.tc-kind-normal {
  background: #fff;
  color: #000;
  font-size: 20px;
}
.tc-kind-normal .tc-box-label {
  font-size: 20px;
}
.tc-discount-10 {
  background: #dcf8ff;
  color: #0c1461;
}

.tc-discount-20 {
  background: #94e9f7;
  color: #0c1461;
}

.tc-discount-30 {
  background: #65d5ef;
  color: #0c1461;
}

.tc-discount-40 {
  background: #1facea;
  color: #0c1461;
}

.tc-discount-50 {
  background: #044fc8;
  color: #fff;
}

.tc-up-10 {
  background: #ffe6eb;
  color: #aa034c;
}

.tc-up-20 {
  background: #ffc0cf;
  color: #aa034c;
}

.tc-up-30 {
  background: #ff92af;
  color: #541225;
}

.tc-up-40 {
  background: #ff5a9d;
  color: #541225;
}

.tc-up-50 {
  background: #db1280;
  color: #fff;
}

/*.tc-up-10 .tc-box-label, .tc-up-20 .tc-box-label, .tc-up-30 .tc-box-label, */
.tc-up-40 .tc-box-label, .tc-up-50 .tc-box-label {
  display: contents;
}

/*.tc-up-10 .tc-box-main, .tc-up-20 .tc-box-main, .tc-up-30 .tc-box-main, */
.tc-up-40 .tc-box-main, .tc-up-50 .tc-box-main {
  display: contents;
  font-size: 14px;
}
/*.tc-up-10 .tc-box-part, .tc-up-20 .tc-box-part, .tc-up-30 .tc-box-part, */
.tc-up-40 .tc-box-part, .tc-up-50 .tc-box-part {
  display: block;
  font-size: 20px;
}

.tc-review {
  outline: 3px solid #f0b429;
  outline-offset: -3px;
}

.tc-output {
  display: block;
  width: 100%;
  max-width: 1160px;
  min-height: 260px;
  margin-top: 10px;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.tc-preview-panel {
  max-width: 1160px;
  margin-top: 24px;
}

.tc-preview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.tc-preview-controls label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.tc-preview-controls select {
  width: 280px;
  max-width: 100%;
}

.tc-preview-stage {
  display: flex;
  align-items: center;
  min-height: 110px;
  padding: 16px 0 0;
}

.tc-preview-swatch {
  width: var(--tc-date-width);
  height: var(--tc-row-height);
}

@media (max-width: 760px) {
  .tc-header,
  .tc-title-row {
    display: block;
  }

  .tc-file-note {
    margin-top: 12px;
  }

  .tc-legend {
    margin-top: 8px;
    flex-wrap: wrap;
  }

  .tc-preview-controls select {
    width: 100%;
  }
}
.tc-visibility-panel { margin: 16px 0; padding: 16px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; }
.tc-visibility-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid #e2e8f0; cursor: pointer; }
.tc-visibility-row input { width: 18px; height: 18px; flex-shrink: 0; }
