.tools-body {
  min-height: 100vh;
  background: #111318;
  color: #f6f7fb;
  font-family: Arial, sans-serif;
}

.tools-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.tools-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.tools-topbar h1 {
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1.1;
}

.tools-topbar p,
.tool-category {
  margin: 0;
  color: #aeb6c7;
}

.tools-back,
.tools-count,
.icon-button,
.tool-action,
.small-action,
.file-input-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid #343947;
  border-radius: 6px;
  background: #171a21;
  color: #fff;
  cursor: pointer;
}

.tools-back {
  padding: 0 14px;
}

.tools-count {
  min-width: 94px;
  padding: 0 12px;
  color: #d6dbea;
}

.tools-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tools-sidebar,
.tool-workspace {
  border: 1px solid #303543;
  border-radius: 8px;
  background: #171a21;
}

.tools-sidebar {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

.tools-search {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #303543;
  color: #aeb6c7;
}

.tools-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
}

.tools-nav {
  max-height: calc(100vh - 98px);
  overflow: auto;
  padding: 8px;
}

.tool-select-wrap {
  display: none;
  padding: 12px;
  border-bottom: 1px solid #303543;
}

.tool-select-wrap label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  color: #b9c0cf;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.nav-group-title {
  margin: 16px 8px 6px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8f98aa;
}

.tool-nav-button {
  width: 100%;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 6px;
  padding: 10px;
  background: transparent;
  color: #eef1f8;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.tool-nav-button:hover,
.tool-nav-button.is-active {
  background: #242936;
}

.tool-workspace {
  min-height: calc(100vh - 104px);
  overflow: hidden;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid #303543;
}

.workspace-header h2 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.15;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.tool-panel {
  padding: 18px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label,
.inline-field label,
.range-value {
  font-size: 12px;
  color: #b9c0cf;
  text-transform: uppercase;
  letter-spacing: .04em;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid #343947;
  border-radius: 6px;
  background: #101218;
  color: #f7f8fb;
  font: 14px/1.45 Arial, sans-serif;
}

textarea {
  min-height: 220px;
  resize: vertical;
  padding: 12px;
}

input,
select {
  min-height: 40px;
  padding: 8px 10px;
}

input[type="color"] {
  padding: 4px;
}

input[type="range"] {
  padding: 0;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.tool-action,
.small-action,
.file-input-label {
  padding: 0 13px;
  font-size: 14px;
}

.tool-action.primary {
  background: #e7ecf8;
  border-color: #e7ecf8;
  color: #111318;
}

.tool-action:hover,
.small-action:hover,
.icon-button:hover,
.file-input-label:hover,
.tools-back:hover {
  background: #2a3040;
  color: #fff;
}

.tool-action.primary:hover {
  background: #fff;
  color: #111318;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.inline-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.output-box,
.preview-box,
.result-list {
  min-height: 120px;
  border: 1px solid #343947;
  border-radius: 6px;
  background: #101218;
  color: #f7f8fb;
  padding: 12px;
  overflow: auto;
  word-break: break-word;
}

.preview-box {
  background: #f8f9fb;
  color: #15171d;
}

.result-list table {
  width: 100%;
}

.result-list th,
.result-list td {
  border-bottom: 1px solid #2f3542;
  padding: 8px;
  text-align: left;
  width: auto;
}

.swatch {
  min-height: 88px;
  border: 1px solid #343947;
  border-radius: 6px;
}

.totp-code {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  border: 1px solid #343947;
  border-radius: 6px;
  background: #101218;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: .08em;
}

.qr-target canvas,
.qr-target img {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  background: #fff;
  padding: 10px;
  border-radius: 6px;
}

.image-preview {
  max-width: 100%;
  max-height: 280px;
  border-radius: 6px;
  background: #fff;
}

.file-input {
  display: none;
}

.muted {
  color: #aeb6c7;
}

.hidden {
  display: none !important;
}

.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;
}

@media (max-width: 900px) {
  .tools-topbar,
  .tools-layout,
  .tool-grid,
  .inline-grid,
  .inline-grid.three,
  .inline-grid.two {
    grid-template-columns: 1fr;
  }

  .tools-sidebar {
    position: static;
    max-height: none;
  }

  .tools-nav {
    max-height: 220px;
  }

  .tools-topbar {
    gap: 12px;
  }

  .tool-select-wrap {
    display: block;
  }
}

@media (max-width: 520px) {
  .tools-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 12px;
  }

  .tools-topbar h1 {
    font-size: 28px;
  }

  .workspace-header {
    align-items: flex-start;
  }

  .tool-panel {
    padding: 12px;
  }

  .tools-nav {
    display: none;
  }

  .tool-nav-button {
    padding: 9px;
  }

  .totp-code {
    font-size: 32px;
  }
}
