.tt-page {
  max-width: 860px;
}

.tt-page-header {
  max-width: 820px;
}

.tt-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tt-description {
  line-height: 1.9;
}

.tt-card {
  padding-bottom: 25px;
}

.tt-card-head {
  margin-bottom: 15px;
  align-items: center;
}

.tt-input-panel {
  display: grid;
  gap: 0;
}

.tt-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(210px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.tt-section-title {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.tt-input-panel .tt-section-title,
.tt-preview-card .tt-section-title {
  margin-bottom: 17px;
}

.tt-input-table {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow-x: hidden;
}

.tt-header-row,
.tt-input-row {
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 0.72fr 1.18fr 1.12fr;
  font-size: 14px;
  padding: 9px 10px;
  border-bottom: 1px solid #ddd;
  min-width: 0;
}

.tt-header-row {
  background: #f6f6f6;
  color: #333;
}

.tt-header-row span,
.tt-input-row .tt-input-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  border-right: 1px solid #ddd;
  min-width: 0;
  padding: 4px 2px;
  margin-right: 0;
}

.tt-header-row span:nth-child(-n+3),
.tt-input-row .tt-input-wrapper:nth-child(-n+3) {
  padding-left: 0;
  padding-right: 0;
  margin-right: 0;
}

.tt-header-row span:nth-child(4),
.tt-header-row span:nth-child(5),
.tt-input-row .tt-input-wrapper:nth-child(4),
.tt-input-row .tt-input-wrapper:nth-child(5) {
  padding-left: 8px;
  padding-right: 8px;
}

.tt-header-row span:last-child,
.tt-input-row .tt-input-wrapper:last-child {
  border-right: none;
  margin-right: 0;
}

.tt-input-row:last-child {
  border-bottom: none;
}

.tt-input-row .tt-input-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.tt-input-row .tt-duration-wrapper {
  padding: 1px 0;
  margin-right: 0;
}

.tt-input-row input {
  padding: 4px 6px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  appearance: auto;
  text-align: center;
  width: 100%;
  max-width: 100px;
  font-family: "Courier New", Courier, monospace;
}

.tt-input-row input[type="number"]::-webkit-inner-spin-button,
.tt-input-row input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  display: block;
  -webkit-appearance: inner-spin-button;
}

.tt-input-row input:focus,
.tt-display-card input:focus-visible,
.tt-display-card select:focus-visible {
  outline: none;
  border-color: var(--cta);
}

.tt-time-group,
.tt-duration-group,
.tt-text-group {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tt-time-group {
  gap: 4px;
}

.tt-time-group input {
  width: 48px;
  max-width: 48px;
}

.tt-time-separator {
  font-size: 16px;
  color: #333;
  margin: 0;
}

.tt-duration-group {
  gap: 0;
}

.tt-duration-group input {
  width: 54px;
  max-width: 54px;
}

.tt-text-group {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.tt-text-group input {
  width: 100%;
  max-width: none;
  font-family: "Noto Sans JP", sans-serif;
}

.tt-input-row .tt-input-wrapper:first-child {
  padding-left: 0;
}

.tt-input-row .tt-input-wrapper:last-child {
  padding-right: 0;
}

.tt-header-row span:first-child {
  padding-left: 0;
}

.tt-header-row span:last-child {
  padding-right: 0;
}

.tt-table-buttons {
  display: flex;
  gap: 10px;
  margin-top: 13px;
}

.tt-round-btn {
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: filter 0.18s ease;
  box-shadow: none;
}

.tt-round-btn:hover {
  filter: brightness(1.08);
}

.tt-round-btn .material-icons {
  font-size: 18px;
  line-height: 1;
  transform: translateY(0);
}

.tt-round-btn-add {
  background: linear-gradient(to right, #7b3fe4, #a855f7);
}

.tt-round-btn-delete {
  background: linear-gradient(to right, #6c6c6c, #8d8d8d);
}

.tt-result-area {
  position: relative;
  background-color: #f5f5f5;
  border-radius: 5px;
  border: 1px solid #ddd;
  flex: 1 1 auto;
}

.tt-result-area:focus-within {
  border-color: var(--cta);
}

.tt-preview-wrap {
  position: relative;
}

.tt-preview-wrap pre {
  background-color: #f5f5f5;
  padding: 10px;
  border-radius: 5px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 15px;
  white-space: pre-wrap;
  min-height: 240px;
  color: #333;
  cursor: text;
  width: 100%;
  margin: 0;
  resize: vertical;
  overflow: auto;
}

.tt-preview-wrap pre:focus {
  outline: none;
}

.tt-export-row {
  margin-top: auto;
  padding-top: 17px;
  display: flex;
  gap: 10px;
}

.tt-export-row .btn-export {
  flex: 1 1 0;
}

.tt-preview-card {
  display: flex;
  flex-direction: column;
}

.tt-display-card {
  background: var(--white);
}

.tt-display-stack {
  display: grid;
  gap: 14px;
}

.tt-option-group {
  display: grid;
  gap: 8px;
}

.tt-option-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
  font-family: var(--mono);
}

.tt-option-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  cursor: pointer;
}

.tt-option-line span {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.35;
}

.tt-display-card .custom-checkbox,
.tt-display-card .custom-radio {
  flex-shrink: 0;
}

#reset-btn:hover {
  background: transparent;
  border-color: var(--orange);
  color: var(--orange);
}

.tt-input-card .card-label {
  margin-bottom: 0;
}

.tt-input-card .card-label-row {
  margin-bottom: 0;
}

.tt-input-card .btn-reset-tool {
  margin-top: -2px;
}

@media (max-width: 720px) {
  .tt-bottom-grid {
    grid-template-columns: 1fr;
  }

  .tt-preview-wrap pre {
    min-height: 220px;
  }
}

@media (max-width: 650px) {
  .tt-description-break {
    display: none;
  }
}

@media (max-width: 600px) {
  .tt-header-row {
    display: none;
  }

  .tt-input-row {
    display: block;
    padding: 15px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 10px;
  }

  .tt-input-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }

  .tt-input-row .tt-input-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
    border-right: none;
    min-height: 40px;
  }

  .tt-input-row .tt-input-wrapper:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }

  .tt-input-row .tt-input-wrapper::before {
    content: attr(data-label);
    display: inline-block;
    width: 86px;
    font-size: 12px;
    color: #666;
    text-align: left;
    flex-shrink: 0;
    padding-left: 8px;
    border-right: 1px solid #ddd;
    box-sizing: border-box;
  }

  .tt-time-group,
  .tt-duration-group,
  .tt-text-group {
    flex-grow: 1;
    justify-content: flex-start;
    padding-left: 16px;
  }

  .tt-input-row input {
    width: 100%;
    max-width: 140px;
    font-size: 12px;
    text-align: left;
  }

  .tt-display-stack {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .tt-page {
    padding-left: 18px;
    padding-right: 18px;
  }

  .tt-card {
    padding-bottom: 18px;
  }

  .tt-input-row {
    padding: 10px;
  }

  .tt-input-row input {
    font-size: 11px;
  }

  .tt-export-row {
    flex-direction: column;
  }
}
