:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --soft: #eef2f6;
  --focus: #111827;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 22px 18px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 14px;
  background: #d8f0ff;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.14);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
}

.brand-num,
.brand-ai,
.brand-tool {
  position: absolute;
  z-index: 1;
  letter-spacing: 0;
}

.brand-num {
  left: 6px;
  top: 15px;
  display: flex;
  align-items: center;
  z-index: 3;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.brand-num span {
  position: relative;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 2px 5px rgba(15, 23, 42, 0.2);
}

.brand-num span + span {
  margin-left: -4px;
}

.brand-num span:nth-child(1) {
  z-index: 1;
  color: #ef4444;
  transform: translateY(-4px);
}

.brand-num span:nth-child(2) {
  z-index: 2;
  color: #facc15;
  transform: translateY(-2px);
}

.brand-num span:nth-child(3) {
  z-index: 3;
  color: #22c55e;
  transform: translateY(2px);
}

.brand-ai {
  right: 5px;
  top: 5px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #155eef;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 5px;
}

.brand-tool {
  right: 6px;
  bottom: 6px;
  z-index: 2;
  width: 20px;
  height: 20px;
  transform: rotate(-38deg);
}

.brand-tool::before,
.brand-tool::after {
  content: "";
  position: absolute;
  display: block;
}

.brand-tool::before {
  left: 1px;
  top: 2px;
  width: 18px;
  height: 7px;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.16);
}

.brand-tool::after {
  left: 9px;
  top: 8px;
  width: 4px;
  height: 13px;
  border-radius: 999px;
  background: #fff7d6;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.16);
}

.brand strong {
  display: block;
  color: #111827;
  font-size: 22px;
  line-height: 1.1;
}

.nav-group {
  position: relative;
  margin: 0 0 8px;
}

.nav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #344054;
  padding: 0 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}

.nav-title::after {
  content: "›";
  color: #98a2b3;
  font-size: 18px;
  line-height: 1;
}

.nav-title:hover,
.nav-title:focus,
.nav-group.has-active .nav-title {
  background: var(--soft);
  color: #101828;
}

.nav-tools {
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  display: grid;
  min-width: 220px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 30;
}

.nav-tools::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 100%;
  bottom: -8px;
  width: 14px;
}

.nav-group:hover .nav-tools,
.nav-group:focus-within .nav-tools {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.nav-tools a {
  display: block;
  padding: 9px 10px;
  border-radius: 7px;
  color: #344054;
  font-size: 14px;
}

.nav-tools a:hover,
.nav-tools a.active {
  background: var(--soft);
  color: #101828;
}

.main {
  display: flex;
  flex-direction: column;
  padding: 34px;
  min-width: 0;
}

.topbar,
.tool-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.tool-header {
  align-items: start;
  display: block;
  padding-bottom: 20px;
  border-bottom: 4px solid var(--accent);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: 0;
}

.tool-header p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: #344054;
  font-size: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 14px;
}

.search-box input {
  width: 100%;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
}

.catalog {
  display: grid;
  gap: 18px;
}

.category {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.category-head {
  display: flex;
  align-items: start;
  gap: 12px;
  margin-bottom: 16px;
}

.category-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 44px;
  border-radius: 5px;
  background: var(--accent);
}

.category h2 {
  margin: 0;
  font-size: 20px;
}

.category p {
  margin: 6px 0 0;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.tool-card {
  display: grid;
  min-height: 96px;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

.tool-card span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.tool-panel {
  max-width: 980px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.wide-tool-panel {
  max-width: none;
}

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

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  outline: 0;
}

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 16px;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: #111827;
  color: #ffffff;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: #273244;
}

.secondary-button {
  border: 1px solid #8a8f98;
  background: #eeeeee;
  color: #111827;
}

.secondary-button:hover {
  background: #e0e0e0;
}

.code-calculator {
  display: grid;
  gap: 10px;
}

.code-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 17px;
}

.code-table th,
.code-table td {
  height: 36px;
  border: 2px solid #bfddff;
  text-align: center;
  vertical-align: middle;
}

.code-table th {
  width: 50%;
  color: #5e97d4;
  font-weight: 800;
}

.code-table td {
  color: #242933;
  font-weight: 500;
}

.code-error {
  color: #b42318;
  font-size: 16px;
}

.code-input {
  width: min(90%, 1620px);
  justify-self: center;
  border: 2px solid #8a8f98;
  border-radius: 4px;
  font-size: 16px;
  padding: 7px 10px;
}

.code-type-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.code-type-row label {
  color: #5e97d4;
  font-size: 17px;
  font-weight: 800;
}

.code-type-row select {
  width: min(320px, 100%);
  border: 2px solid #8a8f98;
  border-radius: 4px;
  font-size: 16px;
  padding: 6px 30px 6px 8px;
}

.code-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.code-actions button {
  min-width: 112px;
  min-height: 36px;
  border: 2px solid #8a8f98;
  border-radius: 4px;
  background: #eeeeee;
  color: #000000;
  font-size: 16px;
  font-weight: 700;
}

.code-actions button:hover {
  background: #e1e1e1;
}

.radix-converter {
  color: #000000;
}

.radix-section {
  display: grid;
  gap: 16px;
  border: 2px solid #e4e4e4;
  border-left: 0;
  padding: 24px 0 14px;
}

.radix-section legend {
  margin-left: 38px;
  padding: 0 22px;
  color: #666666;
  font-size: 22px;
  font-weight: 500;
}

.radix-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 20px);
  flex-wrap: wrap;
  font-size: 16px;
}

.radix-picker > span {
  margin-right: 2px;
}

.radix-picker label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.radix-picker input {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #c7c7c7;
  border-radius: 50%;
  padding: 0;
  background: #ffffff;
}

.radix-picker input:checked {
  border-color: #5dbb7a;
  box-shadow: inset 0 0 0 5px #ffffff;
  background: #5dbb7a;
}

.radix-picker input:focus {
  border-color: #5dbb7a;
  box-shadow: 0 0 0 3px rgba(93, 187, 122, 0.18), inset 0 0 0 5px #ffffff;
}

.radix-select {
  width: 240px;
  height: 40px;
  border: 2px solid #e1e1e1;
  border-radius: 4px;
  color: #000000;
  font-size: 16px;
  font-weight: 700;
  padding: 0 20px;
}

.radix-field {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border: 2px solid #d7d7d7;
  border-radius: 4px;
  min-height: 42px;
}

.radix-field span,
.radix-field input {
  display: flex;
  align-items: center;
  min-height: 38px;
  font-size: 16px;
}

.radix-field span {
  justify-content: center;
  border-right: 2px solid #d7d7d7;
  font-weight: 700;
}

.radix-field input {
  border: 0;
  border-radius: 0;
  color: #111827;
  font-weight: 500;
  padding: 0 20px;
}

.radix-field input::placeholder {
  color: #777777;
}

.radix-field input:focus {
  box-shadow: inset 0 0 0 2px rgba(93, 187, 122, 0.35);
}

.md5-tool-panel {
  border: 0;
  background: transparent;
  padding: 0;
}

.md5-calculator {
  color: #333333;
}

.md5-calculator h2 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.md5-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 72px;
  gap: 2px 16px;
  align-items: center;
}

.md5-grid label {
  justify-self: end;
  color: #333333;
  font-size: 16px;
  font-weight: 700;
}

.md5-grid textarea,
.md5-grid input {
  width: 100%;
  border: 2px solid #d2d2d2;
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 15px;
}

.md5-grid textarea {
  min-height: 100px;
  resize: vertical;
}

.md5-grid input {
  height: 38px;
  background: #eeeeee;
}

.md5-copy {
  min-width: 72px;
  min-height: 38px;
  border-radius: 6px;
  background: #55b35a;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
}

.md5-copy:hover {
  background: #459d4a;
}

.md5-lookup {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 92px;
  gap: 10px 16px;
  align-items: center;
  margin-top: 16px;
}

.md5-lookup label {
  justify-self: end;
  color: #333333;
  font-size: 16px;
  font-weight: 700;
}

.md5-lookup input,
.md5-lookup textarea {
  width: 100%;
  border: 2px solid #d2d2d2;
  border-radius: 6px;
  font-size: 15px;
}

.md5-lookup textarea {
  grid-column: 2 / 4;
  min-height: 74px;
  resize: vertical;
}

.md5-lookup .note {
  grid-column: 2 / 4;
  margin: 0;
}

.uuid-tool {
  display: grid;
  gap: 26px;
}

.uuid-block {
  display: grid;
  gap: 14px;
  border-left: 4px solid #10b981;
  border-radius: 7px 0 0 7px;
  background: #f6f7f9;
  padding: 22px 22px 20px;
}

.uuid-block label,
.uuid-block h2 {
  margin: 0;
  color: #4b5563;
  font-size: 15px;
  font-weight: 900;
}

.uuid-block input[type="number"] {
  width: 100%;
  min-height: 38px;
}

.uuid-options {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: center;
}

.uuid-options label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 92px;
  font-weight: 600;
  white-space: nowrap;
}

.uuid-options input {
  accent-color: #10b981;
}

#uuidResult {
  min-height: 226px;
  resize: vertical;
  background: #ffffff;
}

.uuid-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.uuid-actions button {
  min-width: 68px;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  font-weight: 900;
}

#generateUuid {
  background: #1e90ff;
}

#copyUuid {
  background: #68727d;
}

#clearUuid {
  background: #ff4d4f;
}

.uuid-actions button:hover {
  filter: brightness(0.95);
}

.base64-tool {
  display: grid;
  gap: 18px;
}

.base64-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.base64-section h2 {
  margin: 0;
  color: #344054;
  font-size: 18px;
}

.base64-section textarea {
  min-height: 118px;
}

#fileBase64,
#base64Input {
  min-height: 150px;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 13px;
}

.base64-file-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.base64-file-options label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 800;
}

.base64-info {
  min-height: 74px;
  margin: 0;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f8fafc;
  color: #475467;
  padding: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

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

.qrcode-section {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.qrcode-section h2 {
  margin: 0;
  color: #344054;
  font-size: 18px;
}

.qrcode-section textarea {
  min-height: 122px;
}

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

.qrcode-options label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 800;
}

.qrcode-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 18px;
  overflow: hidden;
}

.qrcode-preview img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.qrcode-preview img:not([src]) {
  display: none;
}

.qrcode-preview span {
  color: #667085;
  text-align: center;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 7px;
  background: #111827;
  color: #ffffff;
  padding: 0 14px;
  font-weight: 800;
}

.button-link:hover {
  background: #253041;
}

.markdown-tool-panel {
  max-width: none;
}

.markdown-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.markdown-pane {
  display: grid;
  gap: 10px;
  align-content: start;
}

.markdown-pane h2 {
  margin: 0;
  color: #344054;
  font-size: 18px;
}

#markdownText,
.markdown-preview {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

#markdownText {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
}

.markdown-preview {
  overflow: auto;
  color: #1f2937;
  line-height: 1.75;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  margin: 16px 0 10px;
}

.markdown-preview pre {
  overflow: auto;
  border-radius: 7px;
  background: #111827;
  color: #e5e7eb;
  padding: 12px;
}

.markdown-preview code {
  border-radius: 4px;
  background: #eef2f7;
  padding: 2px 5px;
}

.markdown-preview pre code {
  background: transparent;
  padding: 0;
}

.markdown-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.text-segment-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.text-segment-section {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.text-segment-section h2 {
  margin: 0;
  color: #344054;
  font-size: 18px;
}

#segmentSource,
#segmentResult {
  min-height: 360px;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
}

.segment-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
}

.segment-controls label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 800;
}

.segment-info {
  min-height: 94px;
  margin: 0;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f8fafc;
  color: #475467;
  padding: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ascii-tool-panel {
  max-width: none;
}

.ascii-tool {
  display: grid;
  gap: 14px;
}

.ascii-query {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.ascii-query label {
  display: grid;
  gap: 8px;
}

.ascii-query span {
  color: #344054;
  font-size: 15px;
  font-weight: 800;
}

.ascii-query input,
.ascii-query select {
  min-height: 38px;
}

.ascii-result {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid #e2e2e2;
  background: #ffffff;
}

.ascii-result div {
  display: grid;
  gap: 6px;
  min-height: 50px;
  align-content: center;
  border-right: 1px solid #e2e2e2;
  padding: 12px;
  text-align: center;
}

.ascii-result div:last-child {
  border-right: 0;
}

.ascii-result span {
  color: #667085;
  font-size: 14px;
  font-weight: 700;
}

.ascii-result strong {
  color: #333333;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ascii-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  color: #b42318;
  font-size: 18px;
  font-weight: 700;
}

.ascii-table-section h2 {
  margin: 4px 0 14px;
  color: #333333;
  text-align: center;
  font-size: 20px;
  letter-spacing: 0;
}

.ascii-table-wrap {
  overflow: visible;
  border: 1px solid #e2e2e2;
  background: #ffffff;
}

.ascii-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #333333;
  font-size: 14px;
}

.ascii-table th,
.ascii-table td {
  border: 2px solid #e5e5e5;
  padding: 6px 6px;
  text-align: center;
  vertical-align: middle;
}

.ascii-table th {
  z-index: 1;
  background: #ffffff;
  font-weight: 700;
}

.ascii-table th span {
  display: inline-block;
  margin-top: 8px;
}

.ascii-table td:nth-child(5) {
  width: 32%;
}

.ascii-table tr.selected td {
  background: #eaf5ff;
  color: #145ea8;
  font-weight: 800;
}

.timestamp-tool-panel {
  border: 0;
  background: transparent;
  overflow-x: auto;
  padding: 0;
}

.timestamp-tool {
  display: grid;
  gap: 24px;
  min-width: 0;
  color: #5f6368;
  font-size: 16px;
}

.timestamp-now {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: -6px -34px 0;
  padding: 16px 24px 18px;
  border-bottom: 1px solid #e3e9f2;
}

.timestamp-now span {
  font-weight: 700;
}

.timestamp-tool input,
.timestamp-tool select {
  height: 38px;
  border: 1px solid #dfe7f2;
  border-radius: 5px;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  padding: 0 10px;
}

.timestamp-tool button {
  min-height: 38px;
  border: 2px solid #2f80ed;
  border-radius: 5px;
  background: transparent;
  color: #2f80ed;
  font-size: 15px;
  font-weight: 800;
  padding: 0 14px;
  white-space: nowrap;
}

.timestamp-tool button:hover {
  background: #edf5ff;
}

#currentTimestamp {
  width: 150px;
  color: #ff3d00;
  font-size: 15px;
}

.timestamp-row {
  display: grid;
  grid-template-columns: 230px 180px 82px 64px minmax(190px, 1fr);
  gap: 10px;
  align-items: center;
}

.timestamp-row label {
  justify-self: end;
  color: #5f6368;
  font-weight: 500;
}

.timestamp-unit {
  color: #8a9099;
  font-weight: 700;
}

.date-string-row {
  grid-template-columns: 230px 190px 158px minmax(190px, 1fr) 82px;
}

.timestamp-parts-row {
  grid-template-columns: 38px 72px 24px 52px 24px 52px 24px 52px 24px 52px 24px 52px 24px 136px minmax(140px, 1fr) 82px;
  gap: 6px;
}

.timestamp-parts-row label {
  justify-self: start;
}

.timestamp-parts-row input {
  width: 100%;
}

.timestamp-parts-row span {
  color: #333333;
  font-weight: 600;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  padding: 36px 0 6px;
  color: #475467;
  font-size: 14px;
}

.site-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.site-footer strong {
  color: #111827;
}

.site-footer button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #344054;
}

.site-footer button:hover {
  background: var(--soft);
}

.site-footer button:disabled {
  background: #f2f4f7;
  color: #98a2b3;
}

.stats-status {
  color: #98a2b3;
  font-size: 13px;
}

.site-copyright {
  margin: 0;
  color: #667085;
  font-size: 13px;
  text-align: center;
}

.site-dialog {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  padding: 0;
}

.site-dialog::backdrop {
  background: rgba(15, 23, 42, 0.36);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.dialog-card h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
}

.dialog-card p {
  margin: 0;
  color: #475467;
  line-height: 1.7;
}

.dialog-card textarea {
  min-height: 150px;
  resize: vertical;
}

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

.shortcut-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.shortcut-grid kbd {
  display: inline-block;
  border: 1px solid #cbd5e1;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #ffffff;
  padding: 2px 7px;
  color: #111827;
  font-weight: 800;
}

.yaml-tool-panel {
  max-width: none;
  padding: 0;
  overflow: hidden;
}

.yaml-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(560px, calc(100vh - 235px)) auto;
  min-height: 660px;
  border-top: 4px solid #10b981;
  background: #ffffff;
}

.yaml-pane {
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  min-width: 0;
  padding: 0 24px 26px;
}

.yaml-pane + .yaml-pane {
  background: #fbfcfd;
  border-left: 1px solid #edf0f4;
}

.yaml-pane h2 {
  align-self: center;
  margin: 0;
  color: #4a5563;
  font-size: 18px;
  font-weight: 900;
}

#yamlText,
.yaml-preview {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: auto;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.06);
  color: #111827;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre;
}

#yamlText {
  resize: none;
  padding: 20px 24px;
}

.yaml-preview {
  padding: 20px 24px;
}

.json-key,
.json-string {
  color: #22b65e;
}

.json-number {
  color: #f97316;
}

.json-literal {
  color: #9b59b6;
  font-weight: 800;
}

.yaml-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  border-top: 1px solid #e6eaf0;
  background: #f6f8fa;
  padding: 12px 18px;
}

.yaml-actions button,
.yaml-file-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid #d8dee8;
  border-radius: 7px;
  background: #ffffff;
  color: #4b5563;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.yaml-actions button:hover,
.yaml-file-button:hover {
  background: #eef8f3;
  border-color: #bfe8d3;
}

.yaml-status {
  min-width: 94px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #d7f5df;
  color: #15803d;
  padding: 0 16px;
  font-weight: 900;
}

.yaml-status.error {
  background: #fee4e2;
  color: #b42318;
}

.output {
  min-height: 128px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1020;
  color: #d9e7ff;
  padding: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.note {
  color: var(--muted);
  margin: -2px 0 12px;
}

.preview {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
}

.preview img,
.canvas-preview {
  max-width: 100%;
  max-height: 520px;
}

audio {
  width: 100%;
  margin: 4px 0 14px;
}

.format-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.format-chips button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #344054;
  font-size: 14px;
}

.format-chips button.active {
  border-color: #2f80ed;
  background: #edf5ff;
  color: #145ea8;
  font-weight: 800;
}

.audio-visuals {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.audio-visuals canvas {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.id-photo-tool {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.id-photo-controls {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.id-photo-controls label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 800;
}

.id-photo-controls input,
.id-photo-controls select {
  width: 100%;
}

.id-photo-stage-wrap {
  display: grid;
  gap: 14px;
}

#idPhotoCanvas {
  width: 100%;
  max-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
  cursor: move;
  touch-action: none;
}

.id-photo-results {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(560px, 1fr);
  gap: 20px;
  align-items: start;
}

.id-photo-results h2 {
  margin: 0 0 12px;
  color: #111827;
  font-size: 26px;
  line-height: 1.25;
}

.id-photo-results canvas {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.photo-sheet-final {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.photo-sheet-final h3 {
  margin: 0;
  color: #344054;
  font-size: 16px;
}

.photo-sheet-final img {
  width: 100%;
  min-height: 360px;
  max-height: 860px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px 16px;
  }

  .nav-tools {
    position: static;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0 8px;
    transform: none;
  }

  .nav-tools::before {
    display: none;
  }

  .nav-group:hover .nav-tools,
  .nav-group:focus-within .nav-tools {
    max-height: 240px;
    padding: 8px;
    opacity: 1;
  }

  .main {
    padding: 22px 16px;
  }

  .topbar {
    align-items: start;
    display: grid;
  }

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

  .code-table,
  .code-input,
  .code-type-row label,
  .code-type-row select,
  .code-actions button {
    font-size: 18px;
  }

  .code-table th,
  .code-table td {
    height: 48px;
  }

  .code-input {
    width: 100%;
  }

  .code-type-row {
    align-items: stretch;
    display: grid;
  }

  .code-actions button {
    min-width: 112px;
    min-height: 46px;
  }

  .radix-section {
    gap: 22px;
    padding: 34px 0 18px;
  }

  .radix-section legend {
    margin-left: 12px;
    font-size: 24px;
  }

  .radix-picker {
    justify-content: flex-start;
    gap: 14px 22px;
    font-size: 18px;
  }

  .radix-picker input {
    width: 28px;
    height: 28px;
    border-width: 2px;
  }

  .radix-select {
    width: 100%;
    height: 54px;
    font-size: 20px;
  }

  .radix-field {
    grid-template-columns: 108px minmax(0, 1fr);
    min-height: 54px;
  }

  .radix-field span,
  .radix-field input {
    min-height: 50px;
    font-size: 18px;
  }

  .md5-calculator h2 {
    margin-bottom: 28px;
    font-size: 34px;
  }

  .md5-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .md5-grid label {
    justify-self: start;
    font-size: 18px;
  }

  .md5-grid textarea {
    min-height: 150px;
  }

  .md5-grid input {
    height: 48px;
    font-size: 16px;
  }

  .md5-lookup {
    grid-template-columns: 1fr;
  }

  .md5-lookup label,
  .md5-lookup textarea,
  .md5-lookup .note {
    grid-column: auto;
    justify-self: stretch;
  }

  .md5-copy {
    justify-self: start;
    min-width: 96px;
    min-height: 44px;
    font-size: 18px;
  }

  .ascii-query,
  .ascii-result {
    grid-template-columns: 1fr;
  }

  .ascii-result div {
    border-right: 0;
    border-bottom: 1px solid #e2e2e2;
  }

  .ascii-result div:last-child {
    border-bottom: 0;
  }

  .ascii-table {
    min-width: 920px;
    font-size: 18px;
  }

  .markdown-editor,
  .id-photo-tool,
  .id-photo-results {
    grid-template-columns: 1fr;
  }

  .shortcut-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .timestamp-tool {
    gap: 32px;
    min-width: 0;
    font-size: 18px;
  }

  .timestamp-now {
    align-items: stretch;
    flex-direction: column;
    margin: 0;
    padding: 22px 0;
  }

  #currentTimestamp {
    width: 100%;
  }

  .timestamp-row,
  .date-string-row,
  .timestamp-parts-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .timestamp-row label,
  .timestamp-parts-row label {
    justify-self: start;
  }

  .timestamp-tool input,
  .timestamp-tool select,
  .timestamp-tool button {
    height: 48px;
    min-height: 48px;
    font-size: 18px;
  }

  .yaml-editor {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 48vh) minmax(420px, 48vh) auto;
  }

  .yaml-pane {
    padding: 0 14px 18px;
  }

  .yaml-pane + .yaml-pane {
    border-left: 0;
    border-top: 1px solid #edf0f4;
  }

  .yaml-actions {
    justify-content: flex-start;
    overflow-x: auto;
  }

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

  .text-segment-tool,
  .segment-controls {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
