.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tool-layout {
  align-items: start;
}

.tool-workspace {
  display: grid;
  gap: 22px;
}

.tool-workspace [hidden] {
  display: none !important;
}

.tool-workspace label,
.tool-workspace legend {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.tool-workspace textarea {
  width: 100%;
  min-height: 220px;
  padding: 16px 18px;
  resize: vertical;
  border: 1px solid #d6dcd3;
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: white;
  font: 500 14px/1.75 "Noto Sans KR", sans-serif;
  transition: border-color .2s, box-shadow .2s;
}

.tool-workspace textarea:focus,
.tool-workspace button:focus-visible,
.tool-workspace a:focus-visible,
.tool-workspace input:focus-visible,
.tool-workspace select:focus-visible {
  border-color: #90ba42;
  box-shadow: 0 0 0 4px rgba(169, 220, 69, .2);
  outline: none;
}

.tool-textarea-large {
  min-height: 390px !important;
}

.tool-label-row,
.tool-meta-row,
.checklist-toolbar,
.quality-control > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tool-save-status,
.tool-meta-row,
.checklist-toolbar > span,
.quality-control small {
  color: #7b857e;
  font-size: 11px;
  font-weight: 700;
}

.tool-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tool-action-row-center {
  justify-content: center;
}

.tool-action-row-end {
  justify-content: flex-end;
}

.tool-button {
  min-height: 46px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5dbd3;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font: 800 12px "Noto Sans KR", sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s, background .2s;
}

.tool-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(24, 32, 28, .1);
}

.tool-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.tool-button-primary {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.tool-button-primary:hover:not(:disabled) {
  background: #2b342f;
}

.tool-button-secondary {
  background: #f5f7f2;
}

.tool-button-quiet {
  border-color: transparent;
  background: transparent;
}

.tool-button-danger {
  color: #a53b45;
}

.tool-feedback {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  color: #355222;
  background: #effbdc;
  font-size: 12px;
  line-height: 1.65;
  font-weight: 700;
}

.tool-feedback.is-error {
  color: #7f2530;
  background: #fff0f1;
}

.inline-tool-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.inline-tool-form .tool-button {
  min-width: 82px;
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: #eef1ec;
}

.segmented-control button,
.timer-presets button {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  color: #667069;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.segmented-control button[aria-pressed="true"],
.timer-presets button:hover:not(:disabled) {
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 10px rgba(24, 32, 28, .08);
}

.checklist-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-item {
  min-height: 54px;
  padding: 8px 10px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e0e5dd;
  border-radius: 13px;
  background: #fbfcfa;
}

.checklist-item label {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.checklist-item input {
  width: 21px;
  height: 21px;
  flex: none;
  accent-color: #18201c;
}

.checklist-item label span {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
}

.checklist-item.is-completed label span {
  color: #8c958f;
  text-decoration: line-through;
}

.checklist-delete {
  min-width: 44px;
  min-height: 40px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  color: #9a4c54;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.checklist-delete:hover {
  background: #fff0f1;
}

.tool-empty-state {
  margin: 0;
  padding: 34px 18px;
  border: 1px dashed #d1d8cf;
  border-radius: 14px;
  color: #8a938d;
  text-align: center;
  font-size: 12px;
}

.timer-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 7px;
  border-radius: 14px;
  background: #eef1ec;
}

.timer-presets button {
  min-height: 44px;
}

.timer-inputs {
  max-width: 350px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
}

.timer-inputs > span {
  padding-bottom: 14px;
  font: 800 24px var(--font-latin);
}

.timer-inputs input {
  text-align: center;
  font: 800 18px var(--font-latin);
}

.time-display {
  padding: 26px 16px;
  border-radius: 22px;
  color: white;
  background:
    radial-gradient(circle at 75% 20%, rgba(199, 243, 106, .24), transparent 30%),
    #18201c;
  text-align: center;
  font: 700 clamp(52px, 8vw, 86px)/1 var(--font-latin);
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}

.time-display.is-finished {
  color: var(--ink);
  background: var(--page-accent);
}

.time-display-stopwatch {
  font-size: clamp(48px, 7vw, 76px);
}

.tool-live-message {
  min-height: 20px;
  margin: 0;
  color: #6b756e;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.lap-panel {
  padding-top: 4px;
  border-top: 1px solid #e2e6df;
}

.lap-list {
  max-height: 300px;
  display: grid;
  gap: 7px;
  margin: 13px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.lap-list li {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 14px;
  border-radius: 10px;
  background: #f5f7f3;
  font-size: 11px;
}

.lap-list strong {
  font: 800 14px var(--font-latin);
  font-variant-numeric: tabular-nums;
}

.lap-list small {
  grid-column: 1 / -1;
  color: #7b857e;
}

.tool-field-row {
  align-items: center;
}

.tool-field-row .field {
  max-width: 160px;
}

.tool-check-field {
  min-height: 44px;
}

.picker-result {
  padding: 24px;
  border-radius: 18px;
  color: white;
  background: #18201c;
}

.picker-result > span {
  display: block;
  margin-bottom: 12px;
  color: var(--page-accent);
  font: 800 10px var(--font-latin);
  letter-spacing: .14em;
}

.picker-result ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 28px;
}

.picker-result li {
  padding: 6px 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 800;
}

.text-cleaner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.text-cleaner-grid > div {
  display: grid;
  gap: 8px;
}

.text-cleaner-grid textarea {
  min-height: 300px;
}

.text-cleaner-grid textarea[readonly] {
  background: #f6f8f4;
}

.tool-options {
  margin: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 16px;
  border: 1px solid #dce2da;
  border-radius: 14px;
}

.tool-options legend {
  padding: 0 7px;
}

.tool-options label {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #566159;
  cursor: pointer;
}

.tool-options input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: #18201c;
}

.image-drop-zone {
  position: relative;
}

.image-drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.image-drop-zone label {
  min-height: 170px;
  padding: 28px;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 2px dashed #cbd3c8;
  border-radius: 18px;
  color: var(--ink);
  background: #f8faf6;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.image-drop-zone label::before {
  content: "＋";
  width: 44px;
  height: 44px;
  margin: 0 auto 5px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--ink);
  font-size: 24px;
}

.image-drop-zone label span {
  color: #7c867f;
  font-size: 11px;
}

.image-drop-zone.is-dragging label,
.image-drop-zone input:focus-visible + label {
  border-color: #8fb942;
  background: #f2fbdc;
  box-shadow: 0 0 0 4px rgba(169, 220, 69, .18);
}

.image-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.quality-control {
  display: grid;
  gap: 9px;
}

.quality-control input[type="range"] {
  height: 28px;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: #18201c;
}

.image-result-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: #f4f7f1;
}

.image-preview-frame {
  min-height: 230px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background:
    linear-gradient(45deg, #e7ebe5 25%, transparent 25%, transparent 75%, #e7ebe5 75%),
    linear-gradient(45deg, #e7ebe5 25%, #fff 25%, #fff 75%, #e7ebe5 75%);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
}

.image-preview-frame img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.image-result-meta {
  display: grid;
  gap: 12px;
  margin: 0;
}

.image-result-meta div {
  padding: 12px;
  border-radius: 11px;
  background: white;
}

.image-result-meta dt {
  margin-bottom: 5px;
  color: #7e8881;
  font-size: 10px;
  font-weight: 800;
}

.image-result-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.home-tool-directory {
  margin-top: 0;
  padding-top: 72px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .text-cleaner-grid,
  .image-result-panel {
    grid-template-columns: 1fr;
  }

  .image-controls {
    grid-template-columns: 1fr 1fr;
  }

  .image-controls .field:last-child {
    grid-column: 1 / -1;
  }

  .tool-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .tool-workspace {
    gap: 18px;
  }

  .tool-textarea-large {
    min-height: 310px !important;
  }

  .inline-tool-form {
    grid-template-columns: 1fr;
  }

  .tool-button,
  .inline-tool-form .tool-button {
    min-width: 0;
    flex: 1 1 130px;
  }

  .checklist-toolbar,
  .tool-meta-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
    padding: 0 7px;
  }

  .timer-presets {
    grid-template-columns: 1fr;
  }

  .time-display {
    padding: 23px 9px;
    font-size: 50px;
  }

  .time-display-stopwatch {
    font-size: 42px;
  }

  .image-controls {
    grid-template-columns: 1fr;
  }

  .image-controls .field:last-child {
    grid-column: auto;
  }

  .image-drop-zone label {
    min-height: 150px;
    padding: 22px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-button,
  .image-drop-zone label {
    transition: none;
  }
}
