/* Abhi Arya Developer Tools — shared design system.
   Tokens follow the abhiarya.com theme: paper, ink, stone and the sunrise accent. */

.aadt {
	--aadt-paper: #f6f2ea;
	--aadt-paper-2: #eee8dc;
	--aadt-surface: #fffdf8;
	--aadt-white: #ffffff;
	--aadt-line: #e4ddcf;
	--aadt-line-2: #cfc6b5;
	--aadt-ink: #1c1a17;
	--aadt-stone: #5f5a51;
	--aadt-muted: #7c766b;
	--aadt-sun: #a8401c;
	--aadt-sun-hover: #8c3416;
	--aadt-sun-tint: #f6e5da;
	--aadt-sun-wash: #fbf2ec;
	--aadt-ok: #2d6a3e;
	--aadt-ok-bg: #e4f0e4;
	--aadt-err: #9b2c22;
	--aadt-err-bg: #f8e1dd;
	--aadt-warn: #7a5b0c;
	--aadt-warn-bg: #f5ecd3;
	--aadt-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
	--aadt-serif: "Fraunces", Georgia, "Times New Roman", serif;
	--aadt-shadow: 0 1px 2px rgba(28, 26, 23, .04), 0 6px 20px rgba(28, 26, 23, .04);
	container-type: inline-size;
	container-name: aadt;
	color: var(--aadt-ink);
	font-size: 1rem;
	line-height: 1.55;
	max-width: 1240px;
	margin: 0 auto;
}
.aadt *, .aadt *::before, .aadt *::after { box-sizing: border-box; }
.aadt [hidden] { display: none !important; }
.aadt .aadt-icon { flex: none; display: block; }
.aadt .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.aadt a { color: var(--aadt-sun); }
.aadt :focus-visible { outline: 3px solid var(--aadt-sun); outline-offset: 2px; }
/* Theme-proofing: themes often style lists, buttons, code and pre globally. */
.aadt ul.aadt-nav-list, .aadt ul.aadt-nav-menu, .aadt ul.aadt-cards, .aadt ul.aadt-related-list, .aadt ul.aadt-tree, .aadt ul.aadt-plain { list-style: none; margin: 0; padding: 0; }
.aadt ul.aadt-nav-list > li, .aadt ul.aadt-cards > li, .aadt ul.aadt-related-list > li, .aadt ul.aadt-tree > li, .aadt ul.aadt-plain > li, .aadt ul.aadt-nav-menu > li { margin: 0; padding: 0; }
.aadt ul.aadt-nav-list > li::before, .aadt ul.aadt-cards > li::before, .aadt ul.aadt-related-list > li::before, .aadt ul.aadt-tree > li::before, .aadt ul.aadt-plain > li::before, .aadt ul.aadt-nav-menu > li::before { content: none; }
.aadt.aadt code, .aadt.aadt pre, .aadt.aadt kbd { font-family: var(--aadt-mono); font-size: inherit; background: none; border: 0; padding: 0; margin: 0; border-radius: 0; box-shadow: none; color: inherit; white-space: inherit; }
.aadt.aadt pre { white-space: pre; }

/* ---------- headings & text ---------- */
.aadt .aadt-h1 { font-family: var(--aadt-serif); font-size: clamp(2rem, 5cqi, 3rem); line-height: 1.1; margin: 0 0 .75rem; letter-spacing: -.02em; }
.aadt .aadt-h2 { font-family: var(--aadt-serif); font-weight: 600; font-size: 1.55rem; line-height: 1.25; margin: 0 0 .75rem; letter-spacing: -.01em; color: var(--aadt-ink); }
.aadt .aadt-h3 { font-size: 1.02rem; font-weight: 650; margin: 1.25rem 0 .35rem; color: var(--aadt-ink); }
.aadt-muted { color: var(--aadt-stone); }
.aadt-lede { font-size: 1.125rem; color: var(--aadt-stone); max-width: 62ch; margin: 0; }

/* ---------- intro row with privacy card ---------- */
.aadt-top { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: center; justify-content: space-between; margin: 0 0 1.75rem; }
.aadt-top .aadt-lede { flex: 1 1 420px; }
.aadt-privacy {
	display: flex; gap: .85rem; align-items: flex-start; flex: 0 1 340px;
	background: var(--aadt-surface); border: 1px solid var(--aadt-line); border-radius: 12px;
	padding: 1rem 1.15rem; box-shadow: var(--aadt-shadow); font-size: .9rem; color: var(--aadt-stone);
}
.aadt-privacy strong { display: block; color: var(--aadt-ink); font-size: .98rem; margin-bottom: .1rem; }
.aadt-privacy-icon { color: var(--aadt-sun); padding-top: .1rem; }

/* ---------- tool strip ---------- */
.aadt-nav { position: relative; z-index: 5; background: var(--aadt-surface); border: 1px solid var(--aadt-line); border-radius: 12px; box-shadow: var(--aadt-shadow); margin: 0 0 1.75rem; }
.aadt .aadt-nav-list { display: flex; align-items: stretch; }
.aadt .aadt-nav-li { flex: 1 1 0; min-width: 0; border-left: 1px solid var(--aadt-line); display: flex; }
.aadt .aadt-nav-li:first-child { border-left: 0; }
.aadt .aadt-nav-li.is-extra { display: none; }
.aadt .aadt-nav-li.is-extra.is-active { display: flex; }
.aadt .aadt-nav-item {
	display: flex; align-items: center; gap: .55rem; width: 100%; padding: .95rem .8rem;
	color: var(--aadt-ink); text-decoration: none; cursor: pointer; list-style: none; position: relative;
}
.aadt .aadt-nav-item::-webkit-details-marker { display: none; }
.aadt .aadt-nav-item:hover { background: var(--aadt-sun-wash); }
.aadt .aadt-nav-li:first-child .aadt-nav-item { border-radius: 11px 0 0 11px; }
.aadt-nav-icon { color: var(--aadt-stone); display: flex; }
.aadt-nav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.aadt-nav-name { font-weight: 650; font-size: .95rem; white-space: nowrap; }
.aadt-nav-sub { font-size: .76rem; color: var(--aadt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aadt .aadt-nav-li.is-active .aadt-nav-item { background: var(--aadt-sun-wash); box-shadow: inset 0 -3px 0 var(--aadt-sun); }
.aadt .aadt-nav-li.is-active .aadt-nav-icon { color: var(--aadt-sun); }
.aadt-nav-more-li { flex: 0 0 auto !important; }
.aadt-nav-more { position: relative; width: 100%; display: flex; }
.aadt-nav-more > summary .aadt-icon:last-child { margin-left: auto; color: var(--aadt-muted); }
.aadt-nav-more[open] > summary { background: var(--aadt-sun-wash); }
.aadt .aadt-nav-menu {
	position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; z-index: 20;
	background: var(--aadt-white); border: 1px solid var(--aadt-line); border-radius: 10px; box-shadow: 0 12px 32px rgba(28, 26, 23, .12); padding: .35rem;
}
.aadt .aadt-nav-menu a { display: flex; align-items: center; gap: .6rem; padding: .65rem .75rem; border-radius: 7px; color: var(--aadt-ink); text-decoration: none; font-weight: 550; font-size: .92rem; }
.aadt .aadt-nav-menu a:hover, .aadt .aadt-nav-menu a[aria-current] { background: var(--aadt-sun-wash); color: var(--aadt-sun); }
.aadt .aadt-nav-menu .aadt-icon { color: var(--aadt-stone); }

/* ---------- workspace card ---------- */
.aadt-workspace { background: var(--aadt-surface); border: 1px solid var(--aadt-line); border-radius: 14px; box-shadow: var(--aadt-shadow); padding: 1.5rem; }
.aadt-tool-head { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; align-items: center; margin-bottom: 1.25rem; }
.aadt-tool-title { display: flex; gap: .95rem; align-items: center; flex: 1 1 320px; min-width: 0; }
.aadt-tool-title .aadt-h2 { margin: 0 0 .15rem; font-size: 1.45rem; }
.aadt-tool-title p { margin: 0; color: var(--aadt-stone); font-size: .93rem; }
.aadt-tile { flex: none; width: 52px; height: 52px; border-radius: 12px; background: var(--aadt-sun-tint); color: var(--aadt-sun); display: flex; align-items: center; justify-content: center; }
.aadt-tile-sm { width: 40px; height: 40px; border-radius: 10px; }
.aadt-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- buttons & controls ---------- */
.aadt .aadt-btn {
	font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.2; letter-spacing: 0; text-transform: none;
	display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
	min-height: 42px; padding: .55rem 1rem; border-radius: 8px; cursor: pointer; white-space: nowrap;
	background: var(--aadt-white); color: var(--aadt-ink); border: 1px solid var(--aadt-line-2); box-shadow: none; text-decoration: none;
}
.aadt .aadt-btn:hover { border-color: var(--aadt-ink); background: var(--aadt-white); color: var(--aadt-ink); }
.aadt .aadt-btn-primary { background: var(--aadt-sun); border-color: var(--aadt-sun); color: #fff; }
.aadt .aadt-btn-primary:hover { background: var(--aadt-sun-hover); border-color: var(--aadt-sun-hover); color: #fff; }
.aadt .aadt-btn-sm { min-height: 36px; padding: .35rem .7rem; font-size: .82rem; }
.aadt .aadt-btn:disabled { opacity: .5; cursor: not-allowed; }
.aadt .aadt-btn.is-done { background: var(--aadt-ok); border-color: var(--aadt-ok); color: #fff; }
.aadt .aadt-linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--aadt-sun); text-decoration: underline; cursor: pointer; min-height: 0; }
.aadt label { cursor: pointer; }
.aadt .aadt-field { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--aadt-ink); }
.aadt .aadt-field > span { color: var(--aadt-stone); font-weight: 600; }
.aadt select, .aadt input[type=text], .aadt input[type=number], .aadt input[type=search], .aadt input[type=datetime-local], .aadt textarea.aadt-plain-input {
	font: inherit; font-size: .92rem; color: var(--aadt-ink); background: var(--aadt-white);
	border: 1px solid var(--aadt-line-2); border-radius: 8px; padding: .5rem .7rem; min-height: 42px; margin: 0; width: 100%; max-width: 100%; box-shadow: none;
}
.aadt input[type=checkbox], .aadt input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--aadt-sun); flex: none; }
.aadt .aadt-check { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 500; min-height: 40px; }
.aadt .aadt-mono { font-family: var(--aadt-mono); }

/* ---------- panels ---------- */
.aadt-grid-2 { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
.aadt-panel { background: var(--aadt-white); border: 1px solid var(--aadt-line); border-radius: 12px; min-width: 0; display: flex; flex-direction: column; }
.aadt-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--aadt-line); min-height: 58px; }
.aadt .aadt-panel-title { font-family: var(--aadt-serif); font-weight: 600; font-size: 1.08rem; margin: 0; color: var(--aadt-ink); }
.aadt-panel-hint { font-size: .8rem; color: var(--aadt-muted); }
.aadt-panel-body { padding: 1rem; flex: 1 1 auto; min-width: 0; }
.aadt-panel-body.is-flush { padding: 0; }
.aadt-panel-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .55rem 1rem; border-top: 1px solid var(--aadt-line); font-size: .8rem; color: var(--aadt-muted); min-height: 38px; align-items: center; }
.aadt-valid { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 650; }
.aadt-valid.is-ok { color: var(--aadt-ok); }
.aadt-valid.is-error { color: var(--aadt-err); }
.aadt-valid::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

/* ---------- editor ---------- */
.aadt-editor {
	--aadt-ed-h: 440px;
	display: grid; grid-template-columns: auto minmax(0, 1fr); height: var(--aadt-ed-h); min-height: 160px;
	font-family: var(--aadt-mono); font-size: .84rem; line-height: 1.62; background: var(--aadt-white); position: relative;
	border-radius: 0 0 12px 12px;
}
.aadt-editor.is-short { --aadt-ed-h: 220px; }
.aadt-editor.is-mini { --aadt-ed-h: 140px; }
.aadt-editor:focus-within { box-shadow: inset 0 0 0 2px var(--aadt-sun); }
.aadt-gutter {
	padding: 12px 10px 12px 12px; min-width: 3.4em; text-align: right; color: #a39d91; background: #fbf9f4;
	border-right: 1px solid var(--aadt-line); overflow: hidden; white-space: pre; user-select: none; font-variant-numeric: tabular-nums;
	border-radius: 0 0 0 12px;
}
.aadt-editor-main { position: relative; min-width: 0; overflow: hidden; }
.aadt.aadt .aadt-hl, .aadt.aadt .aadt-editor textarea {
	position: absolute; inset: 0; margin: 0; padding: 12px 14px; border: 0; border-radius: 0;
	font: inherit; line-height: inherit; letter-spacing: 0; tab-size: 2; -moz-tab-size: 2;
	white-space: pre; word-wrap: normal; overflow-wrap: normal; text-align: left;
}
.aadt.aadt .aadt-hl { overflow: hidden; pointer-events: none; color: var(--aadt-ink); background: transparent; }
.aadt.aadt .aadt-hl code { font: inherit; white-space: pre; display: block; padding: 0; background: none; }
.aadt .aadt-editor textarea {
	width: 100%; height: 100%; resize: none; overflow: auto; background: transparent; color: transparent;
	caret-color: var(--aadt-ink); outline: none; box-shadow: none; min-height: 0;
}
.aadt .aadt-editor textarea::placeholder { color: #aaa397; }
.aadt .aadt-editor textarea::selection { background: rgba(168, 64, 28, .22); color: transparent; }
.aadt .aadt-editor textarea:focus { outline: none; box-shadow: none; }
.aadt-err-line { position: absolute; left: 0; right: 0; background: rgba(155, 44, 34, .1); border-left: 3px solid var(--aadt-err); pointer-events: none; }
.aadt-editor.is-readonly textarea { caret-color: transparent; }

/* syntax colours (light, readable on white) */
.aadt-tk-key, .aadt-tk-tag { color: #8a3412; }
.aadt-tk-string, .aadt-tk-value { color: #1f5a86; }
.aadt-tk-number { color: #2d6a3e; }
.aadt-tk-boolean, .aadt-tk-null, .aadt-tk-meta, .aadt-tk-entity { color: #6b3a9e; }
.aadt-tk-punct, .aadt-tk-index { color: #8a8476; }
.aadt-tk-attr { color: #7a5b0c; }
.aadt-tk-comment { color: #8a8476; font-style: italic; }
.aadt-tk-cdata { color: #2d6a3e; }
.aadt-tk-text { color: var(--aadt-ink); }

/* ---------- tree ---------- */
.aadt-tree-bar { padding: .6rem .75rem; border-bottom: 1px solid var(--aadt-line); }
.aadt-tree-bar .aadt-row { gap: .4rem; align-items: center; }
.aadt .aadt-tree-info { margin: .4rem 0 0; min-height: 1.2em; }
.aadt-tree-empty { padding: .5rem; font-family: inherit; margin: 0; }
.no-types .aadt-type { display: none; }
.aadt-editor.no-gutter { grid-template-columns: minmax(0, 1fr); }
.aadt-editor.no-gutter .aadt-gutter { display: none; }
.aadt-tree-wrap { height: var(--aadt-ed-h, 440px); overflow: auto; padding: .6rem .5rem .8rem; font-family: var(--aadt-mono); font-size: .84rem; line-height: 1.6; position: relative; }
.aadt .aadt-tree .aadt-tree { padding-left: 1.15rem; margin-left: .55rem; border-left: 1px dashed var(--aadt-line); }
.aadt-tree-row { display: flex; align-items: center; gap: .3rem; padding: 1px .35rem; border-radius: 5px; white-space: nowrap; min-height: 26px; }
.aadt-tree-row:hover { background: #faf6ef; }
.aadt-tree-row.is-hit { background: #fbe9b7; }
.aadt .aadt-tree-toggle {
	width: 22px; height: 22px; min-height: 0; flex: none; border: 0; padding: 0; background: none; border-radius: 4px; cursor: pointer; position: relative; color: var(--aadt-stone);
}
.aadt .aadt-tree-toggle::before { content: ""; position: absolute; left: 7px; top: 6px; border: 5px solid transparent; border-left: 7px solid currentColor; border-right: 0; transition: transform .12s; }
.aadt .aadt-tree-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.aadt .aadt-tree-toggle:hover { background: var(--aadt-paper-2); }
.aadt-tree-spacer { width: 22px; flex: none; }
.aadt-type { font-family: inherit; font-size: .7rem; color: var(--aadt-stone); background: var(--aadt-paper-2); border-radius: 4px; padding: 0 .35rem; margin-left: .4rem; line-height: 1.6; }
.aadt-tree-count { color: var(--aadt-muted); }
.aadt-tree-more { padding: .3rem 0 .3rem 1.6rem; }
@media (prefers-reduced-motion: reduce) { .aadt .aadt-tree-toggle::before { transition: none; } }

/* ---------- small segmented tabs (Formatted / Tree) ---------- */
.aadt-seg { display: inline-flex; background: var(--aadt-paper-2); border-radius: 8px; padding: 3px; gap: 2px; }
.aadt .aadt-seg button { font: inherit; font-size: .82rem; font-weight: 600; border: 0; background: none; color: var(--aadt-stone); padding: .35rem .75rem; border-radius: 6px; cursor: pointer; min-height: 34px; }
.aadt .aadt-seg button[aria-selected="true"] { background: var(--aadt-white); color: var(--aadt-ink); box-shadow: 0 1px 2px rgba(28, 26, 23, .08); }

/* ---------- options row ---------- */
.aadt-options { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: flex-end; padding: 1rem 1.1rem; background: var(--aadt-white); border: 1px solid var(--aadt-line); border-radius: 12px; margin-top: 1.25rem; }
.aadt-options-title { width: 100%; font-weight: 650; font-size: .95rem; margin: 0; }
.aadt-options .aadt-field { min-width: 130px; }

/* ---------- status messages ---------- */
.aadt-status { margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 8px; border-left: 3px solid var(--aadt-line-2); background: var(--aadt-paper-2); font-size: .92rem; color: var(--aadt-ink); }
.aadt-status.is-ok { border-left-color: var(--aadt-ok); background: var(--aadt-ok-bg); }
.aadt-status.is-error { border-left-color: var(--aadt-err); background: var(--aadt-err-bg); }
.aadt-status.is-warn { border-left-color: var(--aadt-warn); background: var(--aadt-warn-bg); }
.aadt-note { font-size: .88rem; color: var(--aadt-stone); margin: .75rem 0 0; }
.aadt-callout { display: flex; gap: .6rem; padding: .8rem 1rem; border-radius: 10px; background: var(--aadt-warn-bg); color: var(--aadt-ink); font-size: .92rem; margin: 0 0 1rem; border: 1px solid #ead9a9; }
.aadt-callout strong { color: var(--aadt-warn); }

/* ---------- key/value tables ---------- */
.aadt .aadt-kv { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0; border: 0; }
.aadt .aadt-kv th, .aadt .aadt-kv td { text-align: left; padding: .55rem .75rem; border: 0; border-bottom: 1px solid var(--aadt-line); vertical-align: top; background: none; }
.aadt .aadt-kv th { width: 34%; color: var(--aadt-stone); font-weight: 600; }
.aadt .aadt-kv td { font-family: var(--aadt-mono); font-size: .85rem; overflow-wrap: anywhere; }
.aadt .aadt-kv tr:last-child th, .aadt .aadt-kv tr:last-child td { border-bottom: 0; }
.aadt-copy-cell { display: flex; gap: .5rem; align-items: flex-start; justify-content: space-between; }
.aadt-copy-cell > span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- output boxes ---------- */
.aadt.aadt .aadt-out { font-family: var(--aadt-mono); font-size: .86rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--aadt-white); border: 1px solid var(--aadt-line); border-radius: 10px; padding: .85rem 1rem; margin: 0; min-height: 3rem; max-height: 420px; overflow: auto; }
.aadt-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 650; padding: .15rem .55rem; border-radius: 6px; background: var(--aadt-paper-2); color: var(--aadt-stone); white-space: nowrap; }
.aadt-badge.is-ok { background: var(--aadt-ok-bg); color: var(--aadt-ok); }
.aadt-badge.is-error { background: var(--aadt-err-bg); color: var(--aadt-err); }
.aadt-badge.is-warn { background: var(--aadt-warn-bg); color: var(--aadt-warn); }

/* ---------- guide, FAQ ---------- */
.aadt-section { margin-top: 3rem; }
.aadt-guide { display: grid; gap: 0 3rem; grid-template-columns: minmax(0, 1fr); }
.aadt-prose p, .aadt-prose li { max-width: 72ch; color: #34312b; }
.aadt-prose p { margin: 0 0 .9rem; }
.aadt .aadt-steps { margin: 0; padding-left: 1.3rem; }
.aadt .aadt-steps li { margin: 0 0 .55rem; padding-left: .25rem; }
.aadt-faq-item { border-bottom: 1px solid var(--aadt-line); }
.aadt-faq-item summary { cursor: pointer; padding: 1rem 2rem 1rem 0; font-weight: 650; list-style: none; position: relative; }
.aadt-faq-item summary::-webkit-details-marker { display: none; }
.aadt-faq-item summary::after { content: ""; position: absolute; right: .4rem; top: 1.3rem; width: .5rem; height: .5rem; border-right: 2px solid var(--aadt-stone); border-bottom: 2px solid var(--aadt-stone); transform: rotate(45deg); }
.aadt-faq-item[open] summary::after { transform: rotate(-135deg); top: 1.5rem; }
.aadt-faq-a p { margin: 0 0 1rem; color: var(--aadt-stone); max-width: 72ch; }

/* ---------- hub cards ---------- */
.aadt .aadt-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.aadt .aadt-card-link { display: flex; gap: 1rem; align-items: flex-start; height: 100%; padding: 1.15rem; background: var(--aadt-surface); border: 1px solid var(--aadt-line); border-radius: 12px; color: var(--aadt-ink); text-decoration: none; box-shadow: var(--aadt-shadow); }
.aadt .aadt-card-link:hover { border-color: var(--aadt-sun); }
.aadt .aadt-card-link .aadt-tile { width: 46px; height: 46px; }
.aadt-card-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.aadt-card-title { font-weight: 700; font-size: 1.02rem; }
.aadt-card-text { color: var(--aadt-stone); font-size: .9rem; }

/* ---------- related tools ---------- */
.aadt-related { background: var(--aadt-surface); border: 1px solid var(--aadt-line); border-radius: 14px; padding: 1.25rem; box-shadow: var(--aadt-shadow); }
.aadt-related-head { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1rem; }
.aadt-related-head .aadt-h2 { font-size: 1.2rem; margin: 0 0 .1rem; }
.aadt-related-head p { margin: 0; font-size: .88rem; }
.aadt .aadt-related-list { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.aadt .aadt-related-list a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; text-align: center; min-height: 86px; padding: .8rem .5rem; background: var(--aadt-white); border: 1px solid var(--aadt-line); border-radius: 10px; color: var(--aadt-ink); text-decoration: none; font-size: .86rem; font-weight: 550; }
.aadt .aadt-related-list a:hover { border-color: var(--aadt-sun); color: var(--aadt-sun); }
.aadt .aadt-related-list .aadt-icon { color: var(--aadt-sun); }

/* ---------- regex ---------- */
.aadt-regex-input { display: flex; align-items: stretch; border: 1px solid var(--aadt-line-2); border-radius: 10px; background: var(--aadt-white); overflow: hidden; }
.aadt-regex-input:focus-within { box-shadow: 0 0 0 2px var(--aadt-sun); border-color: var(--aadt-sun); }
.aadt-regex-slash { display: flex; align-items: center; padding: 0 .6rem; font-family: var(--aadt-mono); color: var(--aadt-muted); font-size: 1.05rem; background: #fbf9f4; }
.aadt .aadt-regex-input input[type=text] { border: 0; border-radius: 0; font-family: var(--aadt-mono); font-size: 1rem; min-height: 50px; box-shadow: none; }
.aadt .aadt-regex-input input[type=text]:focus { outline: none; }
.aadt-regex-flags-shown { display: flex; align-items: center; padding: 0 .75rem; font-family: var(--aadt-mono); color: var(--aadt-sun); background: #fbf9f4; min-width: 3.5rem; }
.aadt-flags { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.aadt-flags .aadt-check { font-size: .85rem; }
.aadt-flags code { font-weight: 700; color: var(--aadt-ink); }
.aadt-examples { display: flex; flex-wrap: wrap; gap: .45rem; }
.aadt-regex-view { white-space: pre-wrap; overflow-wrap: anywhere; }
.aadt mark.aadt-m { background: #fbe0c8; color: inherit; border-radius: 3px; box-shadow: 0 0 0 1px #f0c4a0 inset; padding: 0; }
.aadt mark.aadt-m.is-alt { background: #dbe8f5; box-shadow: 0 0 0 1px #b9d0e8 inset; }
.aadt mark.aadt-m.is-empty { display: inline-block; width: 2px; background: var(--aadt-sun); vertical-align: text-bottom; height: 1.1em; }
.aadt-matches { display: grid; gap: .6rem; }
.aadt-match { border: 1px solid var(--aadt-line); border-radius: 10px; background: var(--aadt-white); overflow: hidden; }
.aadt-match-head { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; padding: .5rem .8rem; background: #fbf9f4; border-bottom: 1px solid var(--aadt-line); font-size: .82rem; color: var(--aadt-stone); }
.aadt-match-head code { color: var(--aadt-ink); font-size: .88rem; overflow-wrap: anywhere; }
.aadt-lines { display: grid; }
.aadt-line-row { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .45rem .8rem; border-bottom: 1px solid var(--aadt-line); font-family: var(--aadt-mono); font-size: .85rem; }
.aadt-line-row:last-child { border-bottom: 0; }
.aadt-line-row > span:first-child { color: var(--aadt-muted); text-align: right; }
.aadt-line-row > code { overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- JWT ---------- */
.aadt-jwt-colored { font-family: var(--aadt-mono); font-size: .86rem; line-height: 1.6; overflow-wrap: anywhere; word-break: break-all; }
.aadt-jwt-h { color: #8a3412; }
.aadt-jwt-p { color: #1f5a86; }
.aadt-jwt-s { color: #2d6a3e; }
.aadt-jwt-dot { color: var(--aadt-muted); }

/* ---------- UUID / hash / timestamp ---------- */
.aadt-list-out { font-family: var(--aadt-mono); font-size: .9rem; }
.aadt-list-out li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .45rem .75rem; border-bottom: 1px solid var(--aadt-line); }
.aadt-list-out li:last-child { border-bottom: 0; }
.aadt-list-out li > span { overflow-wrap: anywhere; min-width: 0; }
.aadt-now { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; padding: 1rem 1.1rem; background: var(--aadt-white); border: 1px solid var(--aadt-line); border-radius: 12px; margin-bottom: 1.25rem; }
.aadt-now-val { font-family: var(--aadt-mono); font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.aadt-now-label { font-size: .8rem; color: var(--aadt-stone); display: block; }
.aadt-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.aadt-row > .aadt-field { flex: 1 1 180px; }
.aadt-row > .aadt-field.is-grow { flex: 3 1 260px; }

/* ---------- HTML preview ---------- */
.aadt-preview-frame { width: 100%; height: var(--aadt-ed-h, 440px); border: 0; display: block; background: #fff; border-radius: 0 0 12px 12px; }

/* ---------- responsive ---------- */
@container aadt (min-width: 900px) {
	.aadt-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.aadt-grid-2.is-60 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
	.aadt-guide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@container aadt (max-width: 899px) {
	.aadt-editor { --aadt-ed-h: 340px; }
}
@container aadt (max-width: 760px) {
	.aadt-workspace { padding: 1rem; border-radius: 12px; }
	.aadt-tool-head .aadt-actions { width: 100%; }
	.aadt-tool-head .aadt-actions .aadt-btn { flex: 1 1 auto; }
	.aadt-privacy { flex-basis: 100%; }
	.aadt-tile { width: 44px; height: 44px; }
	.aadt-options { padding: .9rem; }
	.aadt-options .aadt-field { flex: 1 1 140px; }
	.aadt-related { padding: 1rem; }
	.aadt .aadt-related-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.aadt-editor { font-size: .8rem; }
	.aadt-section { margin-top: 2.25rem; }
}

/* ---------- regex layout ---------- */
.aadt-regex-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
.aadt-regex-main { display: grid; gap: 1.25rem; min-width: 0; align-content: start; }
.aadt ul.aadt-ex-list { padding: .4rem; display: grid; gap: .25rem; max-height: 560px; overflow: auto; }
.aadt .aadt-ex { font: inherit; width: 100%; text-align: left; display: flex; flex-direction: column; gap: .15rem; padding: .6rem .75rem; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--aadt-ink); cursor: pointer; min-height: 44px; }
.aadt .aadt-ex:hover { background: var(--aadt-sun-wash); }
.aadt .aadt-ex.is-on { background: var(--aadt-sun-wash); border-color: #efc9b3; }
.aadt-ex-name { font-weight: 650; font-size: .92rem; }
.aadt.aadt .aadt-ex-pat { font-size: .74rem; color: var(--aadt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
.aadt .aadt-flags-set { border: 0; margin: .85rem 0 0; padding: 0; min-width: 0; }
@container aadt (min-width: 900px) {
	.aadt-regex-layout { grid-template-columns: 270px minmax(0, 1fr); }
	.aadt-regex-examples { align-self: start; position: sticky; top: 1rem; }
}
@container aadt (max-width: 899px) {
	.aadt ul.aadt-ex-list { display: flex; gap: .4rem; overflow-x: auto; max-height: none; padding: .6rem; scrollbar-width: thin; }
	.aadt .aadt-ex-list > li { flex: 0 0 auto; }
	.aadt .aadt-ex { border-color: var(--aadt-line); background: var(--aadt-white); white-space: nowrap; padding: .5rem .8rem; }
	.aadt.aadt .aadt-ex-pat { display: none; }
	.aadt-regex-examples .aadt-panel-head { min-height: 0; padding: .6rem .9rem; border-bottom: 0; }
}

/* ---------- small layout helpers used by the tools ---------- */
.aadt-mt { margin-top: 1.25rem; }
.aadt-pad { padding: 1rem; margin: 0; }
.aadt-stack { display: grid; gap: 1.25rem; align-content: start; min-width: 0; }
.aadt-stack-sm { display: grid; gap: .5rem; }
.aadt-border-top { border-top: 1px solid var(--aadt-line); }
.aadt-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.aadt-badges .aadt-badge { white-space: normal; font-size: .84rem; padding: .35rem .7rem; }
.aadt-badge-inline { margin-left: .5rem; vertical-align: middle; }
.aadt-seg-lg button { min-height: 38px !important; padding: .4rem 1rem !important; font-size: .9rem !important; }
.aadt .aadt-field.is-wide { flex: 1 1 100%; }
.aadt .aadt-field-inline { flex-direction: row; align-items: center; gap: .5rem; }
.aadt .aadt-field-inline select { width: auto; min-height: 36px; padding: .3rem .6rem; }
.aadt .aadt-jwt-input { min-height: 7rem; resize: vertical; font-size: .85rem; line-height: 1.5; word-break: break-all; }
.aadt-jwt-colored:not(:empty) { margin-top: .75rem; padding: .75rem .9rem; background: #fbf9f4; border: 1px solid var(--aadt-line); border-radius: 8px; max-height: 9rem; overflow: auto; }
.aadt-claim-desc { display: block; font-weight: 400; font-size: .8rem; color: var(--aadt-muted); margin-top: .1rem; }
.aadt-claim-time { display: block; font-family: inherit; font-size: .8rem; color: var(--aadt-stone); margin-top: .2rem; }
.aadt .aadt-claims th { width: 42%; }
.aadt .aadt-claims th code { font-weight: 650; color: var(--aadt-ink); }
.aadt-b64-img { max-width: 100%; max-height: 260px; border: 1px solid var(--aadt-line); border-radius: 8px; background: repeating-conic-gradient(#f2efe8 0 25%, #fff 0 50%) 50% / 16px 16px; }
.aadt-uuid-scroll { max-height: 440px; overflow: auto; }
.aadt .aadt-hash-table th { width: 9.5rem; white-space: nowrap; }
.aadt-now-zone { flex-basis: 100%; margin: 0; }
.aadt-now .aadt-actions { margin-left: auto; }
@container aadt (max-width: 760px) {
	.aadt-now .aadt-actions { margin-left: 0; }
	.aadt .aadt-hash-table th { width: 6.5rem; white-space: normal; }
	.aadt .aadt-kv th { width: 38%; }
	.aadt-tool-head .aadt-actions .aadt-seg { flex: 1 1 100%; }
	.aadt-tool-head .aadt-actions .aadt-seg button { flex: 1 1 0; }
}

/* =====================================================================
   v1.1 — full-width layout, compact header, bigger tool bar, compact guide/FAQ
   ===================================================================== */

/* Page shell (plugin layout): theme header/footer stay, the body is ours. */
.aadt-page { box-sizing: border-box; width: 100%; max-width: 1288px; margin: 0 auto; padding: 1.25rem clamp(16px, 3vw, 24px) 3.5rem; }

/* Breadcrumbs */
.aadt .aadt-crumbs ol { list-style: none; margin: 0 0 .9rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; font-size: .84rem; color: var(--aadt-muted); }
.aadt .aadt-crumbs li { margin: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
.aadt .aadt-crumbs li + li::before { content: "/"; color: var(--aadt-line-2); margin-right: .1rem; }
.aadt .aadt-crumbs a { color: var(--aadt-stone); text-decoration: none; }
.aadt .aadt-crumbs a:hover { color: var(--aadt-sun); text-decoration: underline; }
.aadt .aadt-crumbs [aria-current] { color: var(--aadt-ink); }

/* Compact header: H1, one intro line under it, privacy badge on the right */
.aadt-hero { margin: 0 0 1.25rem; }
.aadt-hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.aadt-hero-text { flex: 1 1 520px; min-width: 0; }
.aadt.aadt .aadt-hero .aadt-h1 { font-size: clamp(1.65rem, 3.2cqi, 2.3rem); line-height: 1.15; margin: 0 0 .4rem; letter-spacing: -.015em; font-weight: 600; }
.aadt .aadt-hero .aadt-lede { font-size: 1rem; line-height: 1.55; max-width: 72ch; margin: 0; }
.aadt .aadt-hero .aadt-privacy { flex: 0 0 auto; max-width: 360px; padding: .7rem .95rem; font-size: .82rem; gap: .65rem; align-items: center; }
.aadt .aadt-hero .aadt-privacy strong { font-size: .9rem; }
.aadt .aadt-hero .aadt-privacy .aadt-icon { width: 22px; height: 22px; }

/* Bigger tool bar: tiles with room for icon, name and subtitle */
.aadt .aadt-nav { padding: 6px; margin: 0 0 1.5rem; border-radius: 14px; }
.aadt .aadt-nav-list { display: flex; gap: 6px; overflow: visible; }
.aadt .aadt-nav-li { flex: 1 1 0; border-left: 0; }
.aadt .aadt-nav .aadt-nav-item { min-height: 66px; padding: .8rem .85rem; gap: .65rem; border-radius: 10px !important; border: 1px solid transparent; }
.aadt .aadt-nav .aadt-nav-icon .aadt-icon { width: 24px; height: 24px; }
.aadt .aadt-nav-name { font-size: 1rem; }
.aadt .aadt-nav-sub { font-size: .78rem; }
.aadt .aadt-nav-li.is-active .aadt-nav-item { background: var(--aadt-sun-wash); border-color: #efc9b3; box-shadow: inset 0 -3px 0 var(--aadt-sun); }
.aadt .aadt-nav-more-li { flex: 0 0 auto !important; }
.aadt .aadt-nav-more { height: 100%; }

/* Side-by-side input and output as soon as there is room */
@container aadt (min-width: 720px) {
	.aadt-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.aadt-grid-2.is-60 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
@container aadt (min-width: 720px) and (max-width: 899px) {
	.aadt-editor { --aadt-ed-h: 400px; }
}

/* Compact "How to use / Good to know" and FAQ */
.aadt .aadt-section { margin-top: 1.75rem; }
.aadt .aadt-h2.is-sm { font-size: 1.15rem; margin: 0 0 .65rem; }
.aadt-about { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.aadt-about-card { background: var(--aadt-surface); border: 1px solid var(--aadt-line); border-radius: 12px; padding: 1.05rem 1.2rem; }
.aadt .aadt-about-card .aadt-steps { padding-left: 1.15rem; }
.aadt .aadt-about-card .aadt-steps li { font-size: .92rem; line-height: 1.5; margin: 0 0 .4rem; color: #34312b; }
.aadt .aadt-about-card p { font-size: .93rem; margin: 0; color: #34312b; max-width: none; }
.aadt .aadt-notes { margin: 0; display: grid; gap: .6rem; }
.aadt .aadt-notes dt { font-weight: 650; font-size: .92rem; margin: 0; color: var(--aadt-ink); }
.aadt .aadt-notes dd { margin: .1rem 0 0; font-size: .9rem; line-height: 1.5; color: var(--aadt-stone); }
.aadt-faq-grid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 1.75rem; }
.aadt .aadt-faq-item summary { padding: .7rem 1.8rem .7rem 0; font-size: .95rem; }
.aadt .aadt-faq-item summary::after { top: .95rem; }
.aadt .aadt-faq-item[open] summary::after { top: 1.15rem; }
.aadt .aadt-faq-a p { font-size: .9rem; margin: 0 0 .8rem; }
.aadt .aadt-related { padding: 1rem 1.1rem; }
.aadt .aadt-related-head { margin-bottom: .75rem; }
.aadt .aadt-related-list { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .5rem; }
.aadt .aadt-related-list a { min-height: 64px; padding: .55rem .5rem; font-size: .82rem; gap: .3rem; }
@container aadt (min-width: 860px) {
	.aadt-about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.aadt-faq-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Medium widths: tool bar wraps into rows so every tool stays visible */
@container aadt (max-width: 999px) {
	.aadt .aadt-nav-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); overflow: visible; }
	.aadt .aadt-nav-li { flex: none; min-width: 0; }
	.aadt .aadt-nav-li.is-extra { display: flex; }
	.aadt .aadt-nav-more-li { display: none !important; }
}
/* Phones: one scrollable row, no visible scrollbar, soft fade on the right */
@container aadt (max-width: 599px) {
	.aadt .aadt-nav-list { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
	.aadt .aadt-nav-list::-webkit-scrollbar { display: none; }
	.aadt .aadt-nav-li { flex: 0 0 auto; }
	.aadt .aadt-nav .aadt-nav-item { min-height: 52px; padding: .6rem .85rem; }
	.aadt .aadt-nav-sub { display: none; }
	.aadt .aadt-hero .aadt-privacy { max-width: none; flex: 1 1 100%; padding: .5rem .75rem; }
	.aadt .aadt-hero .aadt-privacy span span { display: none; }
	.aadt .aadt-hero .aadt-privacy strong { margin: 0; }
	.aadt .aadt-hero .aadt-privacy .aadt-icon { width: 18px; height: 18px; }
}

/* v1.1 — input left, output right for JWT and Hash */
.aadt .aadt-io { align-items: start; }
.aadt .aadt-io-col { min-width: 0; display: flex; flex-direction: column; gap: .9rem; }
.aadt .aadt-io-col > * { margin-top: 0; margin-bottom: 0; }
.aadt .aadt-stack { display: flex; flex-direction: column; gap: .9rem; }
.aadt .aadt-stack[hidden], .aadt .aadt-io-empty[hidden] { display: none; }
.aadt .aadt-io .aadt-jwt-input { min-height: 13rem; }
.aadt .aadt-io .aadt-badges:empty { display: none; }
.aadt .aadt-hash-table td { overflow-wrap: anywhere; word-break: break-all; }

/* v1.1 — tiles size to their label so long names (Timestamp, Base64) never spill into the next tile */
@container aadt (min-width: 1000px) {
	.aadt .aadt-nav-li { flex: 1 1 auto; min-width: 0; }
	.aadt .aadt-nav .aadt-nav-item { padding: .8rem .7rem; gap: .55rem; }
	.aadt .aadt-nav-name { overflow: hidden; text-overflow: ellipsis; }
}
/* Nine tiles (an extra tool is active) on a mid-size screen: names only, so nothing is cut */
@container aadt (min-width: 1000px) and (max-width: 1239px) {
	.aadt .aadt-nav-list:has(.aadt-nav-li.is-extra.is-active) .aadt-nav-sub { display: none; }
	.aadt .aadt-nav-list:has(.aadt-nav-li.is-extra.is-active) .aadt-nav-item { padding-left: .6rem; padding-right: .6rem; }
}
/* All 9 related tools on one row on desktop */
@container aadt (min-width: 1100px) {
	.aadt .aadt-related-list { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
