/* Free Tools: hub, tool pages and the JSON formatter. Uses the site's tokens from styles.css. */
.ft-page { width: min(1200px, 100%); margin: 0 auto; padding: 24px 16px 40px; }
.ft-breadcrumbs { margin: 0 0 12px; }
.ft-head h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; }
.ft-lead { margin: 0 0 18px; color: var(--muted); font-size: 1.05rem; max-width: 760px; }
.ft-noscript { padding: 12px 14px; border-radius: 12px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-weight: 600; }

/* Hub */
.ft-grid { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ft-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.ft-card-title { font-size: 1.1rem; margin: 0 0 6px; }
.ft-card-title a { color: var(--text); text-decoration: none; }
.ft-card-title a::after { content: " →"; }
.ft-card:hover, .ft-card:focus-within { border-color: #94a3b8; }
.ft-card p { margin: 0; color: #334155; line-height: 1.5; }
.ft-card .ft-card-meta { margin-top: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Content below the tool */
/* .section-wrap sizes itself to the viewport; inside this padded page it must fill the column instead. */
.ft-content { width: auto; max-width: 860px; margin: 24px auto 0; line-height: 1.65; }
.ft-content h2 { margin: 26px 0 10px; font-size: 1.3rem; }
.ft-content h2:first-child { margin-top: 0; }
.ft-content p { margin: 0 0 12px; }
.ft-list { margin: 0 0 12px; padding-left: 1.3rem; }
.ft-list li { margin: 6px 0; }
.ft-faq { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: 8px 0; }
.ft-faq summary { cursor: pointer; padding: 12px 14px; font-weight: 700; min-height: 44px; }
.ft-faq p { padding: 0 14px 12px; margin: 0; }
.ft-cta { margin-top: 28px; padding: 18px 20px; border-radius: 16px; background: #0f172a; color: #e2e8f0; }
.ft-cta h2 { color: #fff; margin: 0 0 6px; font-size: 1.15rem; }
.ft-cta p { margin: 0; }
.ft-cta a { color: #fde68a; font-weight: 700; }

/* Buttons and focus */
.ft-btn { min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid #94a3b8; background: #fff; color: #0f172a; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.ft-btn:hover { background: #f1f5f9; }
.ft-btn-primary { background: #0f172a; border-color: #0f172a; color: #fff; }
.ft-btn-primary:hover { background: #1e293b; }
.ft-btn-small { min-height: 36px; padding: 4px 10px; font-size: 13px; }
.ft-btn:disabled { opacity: 0.6; cursor: progress; }
.ft-page :focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

/* JSON formatter */
.ft-tool { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.jf-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.jf-actions, .jf-options, .jf-out-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jf-field { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.jf-select { min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid #94a3b8; background: #fff; font: inherit; font-size: 14px; }
.jf-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; cursor: pointer; }
.jf-check input { width: 20px; height: 20px; }
.jf-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.jf-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.jf-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.jf-pane { display: flex; flex-direction: column; min-width: 0; }
.jf-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; margin: 0 0 6px; }
.jf-label { font-weight: 800; font-size: 14px; margin: 0; }
.jf-pane > .jf-label { display: flex; align-items: center; min-height: 40px; margin: 0 0 6px; }
.jf-text { width: 100%; height: 440px; resize: vertical; padding: 10px 12px; border: 1px solid #94a3b8; border-radius: 12px; background: #f8fafc; color: #0f172a;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; tab-size: 4; white-space: pre; overflow: auto; }
.jf-text[aria-invalid="true"] { border-color: #dc2626; }
.jf-output { background: #f1f5f9; }
.jf-out-actions { margin-top: 8px; }
.jf-tabs { display: inline-flex; border: 1px solid #94a3b8; border-radius: 10px; overflow: hidden; }
.jf-tab { min-height: 36px; min-width: 64px; padding: 4px 12px; border: 0; background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.jf-tab[aria-selected="true"] { background: #0f172a; color: #fff; }
.jf-error { margin-top: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid #fecaca; background: #fef2f2; color: #7f1d1d; }
.jf-error p { margin: 0 0 6px; overflow-wrap: anywhere; }
.jf-error-msg { font-weight: 800; }
.jf-error-hint { color: #991b1b; }
.jf-status { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: #f1f5f9; font-weight: 600; overflow-wrap: anywhere; }
.jf-status.is-valid { background: #ecfdf5; color: #065f46; }
.jf-status.is-invalid { background: #fef2f2; color: #991b1b; }
.jf-warnings { list-style: none; padding: 0; margin: 8px 0 0; }
.jf-warnings li { margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: 14px; overflow-wrap: anywhere; }
.jf.is-busy { cursor: progress; }
.jf-tree { height: 440px; overflow: auto; padding: 10px 12px; border: 1px solid #94a3b8; border-radius: 12px; background: #f8fafc;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.jf-tree details > summary { cursor: pointer; padding: 2px 0; }
.jf-children { padding-left: 18px; border-left: 1px dashed #cbd5e1; margin-left: 5px; }
.jf-leaf { padding: 1px 0 1px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.jf-k { color: #6d28d9; }
.jf-type { color: #64748b; }
.jf-v-str { color: #047857; }
.jf-v-num { color: #1d4ed8; }
.jf-v-lit { color: #b45309; font-weight: 700; }
.jf-more { margin: 4px 0 4px 14px; }
.jf-muted { color: var(--muted); }

/* URL encoder & decoder */
.uc-switches { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.uc-seg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0; border: 0; padding: 0; margin: 0; }
.uc-seg legend { float: left; margin-right: 8px; font-size: 14px; font-weight: 800; }
.uc-seg label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border: 1px solid #94a3b8;
  background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.uc-seg label:first-of-type { border-radius: 10px 0 0 10px; }
.uc-seg label:last-of-type { border-radius: 0 10px 10px 0; border-left: 0; }
.uc-seg input { width: 18px; height: 18px; accent-color: #0f172a; }
.uc-seg label:has(input:checked) { background: #0f172a; border-color: #0f172a; color: #fff; }
.uc-seg label:has(input:checked) input { accent-color: #fff; }
.uc-seg label:has(input:focus-visible) { outline: 3px solid #2563eb; outline-offset: 2px; }
.uc-hint { font: 12px ui-monospace, Consolas, monospace; font-weight: 400; opacity: 0.8; }
.uc-options { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 6px; }
.uc-options .is-off { opacity: 0.5; }
.uc-actions { margin-top: 6px; }
.uc-text { height: 220px; white-space: pre-wrap; overflow-wrap: anywhere; }
.uc-text.uc-nowrap { white-space: pre; overflow-wrap: normal; }
.uc-count { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.uc-partial { color: #92400e; font-weight: 700; }
.uc-parse { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.uc-parse-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.uc-parse-title { font-size: 1.05rem; margin: 0; }
.uc-warn { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: 14px; }
.uc-parts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 12px 0; font-size: 14px; }
.uc-parts dt { font-weight: 800; }
.uc-parts dd { margin: 0; font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.uc-table-wrap { overflow-x: auto; }
.uc-params { width: 100%; border-collapse: collapse; font-size: 14px; }
.uc-params caption { text-align: left; font-weight: 700; margin-bottom: 6px; }
.uc-params th, .uc-params td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.uc-params td { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; word-break: break-word; }
.uc-params td:first-child { color: var(--muted); width: 2.5em; }
.uc-muted { color: var(--muted); font-style: italic; }
.uc-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

@media (max-width: 860px) {
  .jf-panes { grid-template-columns: 1fr; }
  .jf-text, .jf-tree { height: 300px; }
}
@media (max-width: 480px) {
  .ft-content { padding: 20px 16px; }
  .uc-seg { width: 100%; }
  .uc-seg legend { float: none; width: 100%; margin: 0 0 4px; }
  .uc-seg label { flex: 1 1 0; justify-content: center; }
  .uc-hint { display: none; }
  .ft-tool { padding: 10px; border-radius: 14px; }
  .jf-actions .ft-btn, .jf-out-actions .ft-btn { flex: 1 1 calc(50% - 8px); }
  .jf-bar { align-items: stretch; }
}
