/* Shared tool-page additions. The core tool visual language remains in site.css. */
.tool-output {
    width: 100%;
    min-width: 0;
    border: 3px solid var(--ink);
    background: var(--ink);
    color: var(--green);
    padding: 16px;
    outline: none;
    font: 700 1rem/1.55 "Courier New", monospace;
}

.uuid-result-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 12px;
}

.uuid-output {
    min-height: 190px;
    resize: vertical;
}

.uuid-copy { min-height: 54px; }
.uuid-count-control { margin-top: 28px; }
.option-grid-two { grid-template-columns: repeat(2, 1fr); }
.option-grid-two label:nth-of-type(2) { border-right: 0; }

.tool-workbench-card { padding-bottom: 28px; }

.tool-action-bar,
.tool-footer-actions,
.mode-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-action-bar { margin-bottom: 20px; }
.tool-footer-actions { margin-top: 18px; }
.mode-row { justify-content: space-between; margin-bottom: 20px; }
.tool-action-spacer { flex: 1 1 auto; }

.button.compact {
    min-height: 42px;
    padding: 9px 14px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .45;
    transform: none;
    box-shadow: 3px 3px 0 var(--ink);
}

.utility-link-button {
    border: 0;
    border-bottom: 2px solid var(--ink);
    background: transparent;
    padding: 7px 2px 4px;
    cursor: pointer;
    font: 700 .68rem "Courier New", monospace;
    letter-spacing: .04em;
}

.utility-link-button:hover,
.utility-link-button:focus-visible {
    background: var(--yellow);
    outline: 0;
}

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

.editor-panel {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    border: 2px solid var(--ink);
    background: var(--paper);
}

.editor-panel > span,
.editor-panel-label {
    display: block;
    padding: 9px 11px;
    border-bottom: 2px solid var(--ink);
    background: var(--paper-deep);
    font: 700 .65rem "Courier New", monospace;
    letter-spacing: .07em;
}

.code-editor-shell {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
    background: var(--white);
    overflow: hidden;
}

.output-editor-shell { background: #f7f4e9; }

.line-number-gutter {
    min-width: 48px;
    height: 100%;
    margin: 0;
    padding: 16px 10px 16px 8px;
    overflow: hidden;
    border-right: 1px solid var(--paper-deep);
    background: #e9e4d6;
    color: #807a6d;
    text-align: right;
    user-select: none;
    white-space: pre;
    font: 700 .9rem/1.55 "Courier New", monospace;
}

.output-editor-shell .line-number-gutter { background: #e5e0d2; }

.code-editor {
    width: 100%;
    min-width: 0;
    min-height: 300px;
    resize: vertical;
    border: 0;
    outline: 0;
    background: var(--white);
    color: var(--ink);
    padding: 16px;
    white-space: pre;
    overflow: auto;
    font: 700 .9rem/1.55 "Courier New", monospace;
    tab-size: 2;
}

.output-editor { background: #f7f4e9; }

.tool-status {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: stretch;
    margin-top: 16px;
    border: 2px solid var(--ink);
    min-height: 44px;
}

.tool-status strong {
    display: grid;
    place-items: center;
    min-width: 92px;
    padding: 8px 11px;
    border-right: 2px solid var(--ink);
    background: var(--paper-deep);
    font: 900 .68rem "Arial Black", Arial, sans-serif;
}

.tool-status span {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    font: 700 .68rem/1.35 "Courier New", monospace;
}

.tool-status[data-state="success"] strong { background: var(--green); }
.tool-status[data-state="error"] strong { background: #e94b35; color: var(--white); }

.mode-switch {
    display: inline-grid;
    grid-template-columns: repeat(2, auto);
    border: 2px solid var(--ink);
}

.mode-button {
    min-height: 40px;
    border: 0;
    border-right: 2px solid var(--ink);
    background: var(--white);
    padding: 9px 18px;
    cursor: pointer;
    font: 900 .7rem "Courier New", monospace;
}

.mode-button:last-child { border-right: 0; }
.mode-button.active { background: var(--orange); }

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 700 .68rem "Courier New", monospace;
}

.inline-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--orange);
}

.salesforce-hint {
    color: var(--muted);
    font: 700 .66rem "Courier New", monospace;
}

.related-tools {
    margin-top: 56px;
    padding-top: 28px;
    border-top: 3px solid var(--ink);
}

.related-tools-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.related-tools-heading > span {
    color: var(--orange);
    font: 900 .68rem/1.2 "Courier New", monospace;
    letter-spacing: .1em;
}

.related-tools-heading h2 {
    margin: 0;
    font-family: "Arial Black", Impact, sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    line-height: .95;
    letter-spacing: -.04em;
    text-transform: uppercase;
}

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

.related-tool-card {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 14px;
    border: 2px solid var(--ink);
    background: var(--white);
    box-shadow: 4px 4px 0 var(--paper-deep);
    color: var(--ink);
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.related-tool-card:hover,
.related-tool-card:focus-visible {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--ink);
    background: var(--yellow);
    outline: 0;
}

.related-tool-code {
    font: 700 .6rem "Courier New", monospace;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.related-tool-glyph {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 2px solid var(--ink);
    background: var(--orange);
    font: 900 .78rem "Courier New", monospace;
}

.related-tool-card b {
    display: block;
    font: 900 .78rem/1.2 "Arial Black", Arial, sans-serif;
    text-transform: uppercase;
}

.related-tool-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font: 700 .58rem/1.3 "Courier New", monospace;
}

.related-tool-card > strong {
    color: var(--orange);
    font-size: 1.25rem;
}

/* WT-009 Text Diff */
.diff-input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.diff-textarea {
    width: 100%;
    min-width: 0;
    min-height: 260px;
    resize: vertical;
    border: 0;
    outline: 0;
    background: var(--white);
    color: var(--ink);
    padding: 16px;
    white-space: pre;
    overflow: auto;
    font: 700 .88rem/1.55 "Courier New", monospace;
    tab-size: 4;
}

.diff-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 2px solid var(--ink);
    background: var(--paper);
}

.diff-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 16px;
    border: 2px solid var(--ink);
    background: var(--white);
}

.diff-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 62px;
    padding: 12px 16px;
    border-right: 2px solid var(--ink);
}

.diff-summary > div:last-child { border-right: 0; }
.diff-summary span { font: 700 .64rem "Courier New", monospace; letter-spacing: .06em; }
.diff-summary strong { font: 900 1.65rem "Arial Black", Arial, sans-serif; }

.diff-result-panel {
    margin-top: 18px;
    border: 2px solid var(--ink);
    background: var(--white);
}

.diff-result-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

.diff-result-heading .mini-copy { margin-left: auto; }

.diff-output {
    max-height: 560px;
    overflow: auto;
    background: #fffefa;
}

.diff-line {
    display: grid;
    grid-template-columns: 52px 52px 32px minmax(0, 1fr);
    align-items: stretch;
    min-height: 31px;
    border-bottom: 1px solid #ded8ca;
    font: 700 .78rem/1.45 "Courier New", monospace;
}

.diff-line:last-child { border-bottom: 0; }
.diff-line-number {
    display: grid;
    place-items: start end;
    padding: 7px 9px;
    border-right: 1px solid #ded8ca;
    background: #ede8dc;
    color: #746f65;
    user-select: none;
}

.diff-marker {
    display: grid;
    place-items: start center;
    padding: 7px 4px;
    border-right: 1px solid #ded8ca;
    font-size: .9rem;
}

.diff-line pre {
    min-width: 0;
    margin: 0;
    padding: 7px 11px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font: inherit;
}

.diff-add { background: #e8f3dc; }
.diff-add .diff-marker { background: var(--green); }
.diff-remove { background: #f8dfda; }
.diff-remove .diff-marker { background: #e94b35; color: var(--white); }
.diff-same .diff-marker { color: #aaa397; }

.diff-empty,
.email-empty-state {
    padding: 28px 18px;
    color: var(--muted);
    text-align: center;
    font: 700 .7rem "Courier New", monospace;
    letter-spacing: .06em;
}

/* WT-010 Email Header Analyzer */
.email-header-input {
    width: 100%;
    min-height: 250px;
    resize: vertical;
    border: 2px solid var(--ink);
    outline: 0;
    background: var(--white);
    color: var(--ink);
    padding: 16px;
    font: 700 .78rem/1.55 "Courier New", monospace;
    tab-size: 4;
}

.email-header-input:focus { box-shadow: 4px 4px 0 var(--orange); }

.email-analysis-section {
    margin-top: 20px;
    border: 2px solid var(--ink);
    background: var(--white);
}

.email-auth-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.email-auth-card {
    min-width: 0;
    min-height: 132px;
    padding: 18px;
    border-right: 2px solid var(--ink);
    background: var(--white);
}

.email-auth-card:last-child { border-right: 0; }
.email-auth-card > span { display: block; font: 900 .68rem "Courier New", monospace; letter-spacing: .08em; }
.email-auth-card > strong { display: block; margin: 8px 0; font: 900 1.45rem "Arial Black", Arial, sans-serif; }
.email-auth-card > small { display: block; color: #4d4941; overflow-wrap: anywhere; font: 700 .62rem/1.45 "Courier New", monospace; }
.email-auth-card[data-state="success"] { background: #e8f3dc; }
.email-auth-card[data-state="success"] > strong { color: #244b15; }
.email-auth-card[data-state="error"] { background: #f8dfda; }
.email-auth-card[data-state="error"] > strong { color: #9f2718; }
.email-auth-card[data-state="warning"] { background: var(--yellow); }

.email-auth-note {
    margin: 0;
    padding: 10px 14px;
    border-top: 2px solid var(--ink);
    background: var(--paper);
    color: var(--muted);
    font: 700 .62rem/1.45 "Courier New", monospace;
}

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

.email-overview-grid .result-copy-row {
    border: 0;
    border-right: 1px solid var(--paper-deep);
    border-bottom: 1px solid var(--paper-deep);
}

.email-overview-grid .result-copy-row:nth-child(even) { border-right: 0; }
.email-wide-row { grid-column: 1 / -1; border-right: 0 !important; }

.email-domain-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.email-domain-grid > div {
    min-width: 0;
    min-height: 82px;
    padding: 14px;
    border-right: 1px solid var(--paper-deep);
}

.email-domain-grid > div:last-child { border-right: 0; }
.email-domain-grid span { display: block; color: var(--muted); font: 700 .6rem "Courier New", monospace; letter-spacing: .05em; }
.email-domain-grid strong { display: block; margin-top: 8px; overflow-wrap: anywhere; font: 900 .76rem/1.35 "Courier New", monospace; }

.received-hop-list { background: #fffefa; }
.received-hop {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    border-bottom: 1px solid var(--paper-deep);
}

.received-hop:last-child { border-bottom: 0; }
.received-hop-number {
    display: grid;
    place-items: start center;
    padding: 15px 8px;
    border-right: 2px solid var(--ink);
    background: var(--paper);
    color: var(--orange);
    font: 900 .62rem "Courier New", monospace;
}

.received-hop-body { min-width: 0; padding: 13px 15px; }
.received-hop-body strong { display: block; overflow-wrap: anywhere; font: 900 .78rem/1.35 "Arial Black", Arial, sans-serif; text-transform: uppercase; }
.received-hop-body > span { display: block; margin-top: 5px; color: #5c574f; overflow-wrap: anywhere; font: 700 .65rem/1.35 "Courier New", monospace; }
.received-hop-body small { display: block; margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; font: 400 .62rem/1.4 "Courier New", monospace; }

.email-review-notes { padding: 12px; display: grid; gap: 8px; }
.email-review-item {
    padding: 11px 12px;
    border: 1px solid var(--ink);
    background: var(--paper);
    font: 700 .68rem/1.45 "Courier New", monospace;
}

.email-review-item[data-level="success"] { background: #e8f3dc; }
.email-review-item[data-level="warning"] { background: var(--yellow); }
.email-review-item[data-level="danger"] { background: #f8dfda; border-width: 2px; }

.email-raw-auth {
    margin-top: 20px;
    border: 2px solid var(--ink);
    background: var(--paper);
}

.email-raw-auth summary {
    cursor: pointer;
    padding: 11px 13px;
    font: 900 .66rem "Courier New", monospace;
    letter-spacing: .05em;
}

.email-raw-auth pre {
    max-height: 260px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border-top: 2px solid var(--ink);
    background: var(--ink);
    color: var(--green);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 700 .68rem/1.5 "Courier New", monospace;
}

@media (max-width: 900px) {
    .related-tool-grid { grid-template-columns: 1fr; }
    .email-domain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .email-domain-grid > div:nth-child(2) { border-right: 0; }
    .email-domain-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--paper-deep); }
}

@media (max-width: 680px) {
    .uuid-result-row { grid-template-columns: 1fr; }
    .uuid-output { min-height: 220px; }
    .uuid-copy { min-height: 48px; }
    .option-grid-two { grid-template-columns: 1fr; }
    .option-grid-two label { border-right: 0; }
    .option-grid-two label:nth-of-type(2) { border-top: 2px solid var(--ink); }
    .related-tools-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
    .editor-grid { grid-template-columns: 1fr; }
    .code-editor { min-height: 220px; }
    .line-number-gutter { min-width: 42px; }
    .tool-action-bar, .tool-footer-actions, .mode-row { align-items: stretch; }
    .tool-action-spacer { display: none; }
    .tool-footer-actions .button { flex: 1 1 auto; }
    .mode-row { flex-direction: column; }
    .mode-switch { width: 100%; }
    .mode-button { width: 100%; }
    .tool-status { grid-template-columns: 1fr; }
    .tool-status strong { border-right: 0; border-bottom: 2px solid var(--ink); }

    .diff-input-grid { grid-template-columns: 1fr; }
    .diff-textarea { min-height: 210px; }
    .diff-summary { grid-template-columns: 1fr; }
    .diff-summary > div { border-right: 0; border-bottom: 1px solid var(--ink); }
    .diff-summary > div:last-child { border-bottom: 0; }
    .diff-line { grid-template-columns: 38px 38px 28px minmax(0, 1fr); font-size: .7rem; }
    .diff-line-number { padding-inline: 6px; }

    .email-auth-grid { grid-template-columns: 1fr; }
    .email-auth-card { border-right: 0; border-bottom: 2px solid var(--ink); }
    .email-auth-card:last-child { border-bottom: 0; }
    .email-overview-grid { grid-template-columns: 1fr; }
    .email-overview-grid .result-copy-row { border-right: 0; }
    .email-wide-row { grid-column: auto; }
    .email-domain-grid { grid-template-columns: 1fr; }
    .email-domain-grid > div { border-right: 0; border-bottom: 1px solid var(--paper-deep); }
    .email-domain-grid > div:last-child { border-bottom: 0; }
    .received-hop { grid-template-columns: 64px minmax(0, 1fr); }
}
