:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #f0f5ff;
    --text: #13213c;
    --muted: #60708d;
    --line: #dfe5ef;
    --primary: #155eef;
    --primary-dark: #0d47c5;
    --green: #067647;
    --green-soft: #ecfdf3;
    --amber: #b54708;
    --amber-soft: #fffaeb;
    --shadow: 0 14px 40px rgba(21, 36, 67, .08);
    --radius: 16px;
    --sidebar-width: 252px;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(21, 94, 239, .32);
    outline-offset: 3px;
}

.container {
    width: min(100% - 32px, 1180px);
    margin-inline: auto;
}

.narrow {
    width: min(100% - 32px, 860px);
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 14px;
    color: #fff;
    background: var(--text);
    border-radius: 8px;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid rgba(223, 229, 239, .9);
    backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 10px;
    font-size: 15px;
    letter-spacing: -.04em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.main-nav a {
    padding: 8px 11px;
    color: #42516d;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.main-nav a:hover {
    color: var(--primary);
    background: var(--surface-soft);
}

/* App Shell -------------------------------------------------------------- */
.workspace-header {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.workspace-header-inner {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 24px;
}

.workspace-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.workspace-label {
    color: var(--muted);
    font-size: 13px;
}

.header-tool-link {
    padding: 7px 11px;
    color: var(--primary);
    background: var(--surface-soft);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

.mobile-menu-button,
.sidebar-mobile-header button {
    width: 40px;
    height: 40px;
    display: none;
    place-items: center;
    padding: 0;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.mobile-menu-button svg,
.sidebar-mobile-header svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.workspace-shell {
    min-height: calc(100vh - var(--header-height));
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    align-items: start;
}

.tool-sidebar {
    position: sticky;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    color: #34425d;
    background: #fff;
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
}

.sidebar-heading {
    padding: 22px 20px 14px;
}

.sidebar-heading span,
.sidebar-heading small {
    display: block;
}

.sidebar-heading span {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
}

.sidebar-heading small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.sidebar-mobile-header {
    display: none;
}

.tools-navigation {
    padding: 0 10px 24px;
}

.tool-category + .tool-category {
    margin-top: 3px;
}

.tool-category-toggle {
    width: 100%;
    min-height: 46px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    color: #34425d;
    background: transparent;
    border: 0;
    border-radius: 9px;
    text-align: left;
    cursor: pointer;
}

.tool-category-toggle:hover {
    color: var(--primary);
    background: #f7f9fc;
}

.tool-category-icon,
.tool-category-chevron {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tool-category-icon {
    width: 21px;
    height: 21px;
}

.tool-category-chevron {
    width: 18px;
    height: 18px;
    transition: transform .15s ease;
}

.tool-category.is-open .tool-category-toggle {
    color: var(--text);
    font-weight: 700;
}

.tool-category.is-open .tool-category-chevron {
    transform: rotate(180deg);
}

.tool-category-panel ul {
    margin: 2px 0 6px;
    padding: 0;
    list-style: none;
}

.tool-nav-item {
    position: relative;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 2px 0;
    padding: 8px 10px 8px 43px;
    color: #52617b;
    border-radius: 8px;
    font-size: 13px;
}

a.tool-nav-item:hover {
    color: var(--primary);
    background: #f7f9fc;
}

.tool-nav-item.is-active {
    color: var(--primary-dark);
    background: #eaf2ff;
    font-weight: 750;
}

.tool-nav-item.is-active::before {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    content: "";
}

.tool-nav-item.is-disabled {
    color: #929db0;
    cursor: not-allowed;
}

.tool-nav-item.is-disabled small {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.tool-category-empty {
    margin: 2px 0 8px;
    padding: 8px 10px 8px 43px;
    color: #929db0;
    font-size: 11px;
}

.app-main {
    position: relative;
    min-width: 0;
    min-height: calc(100vh - var(--header-height));
    background: var(--bg);
}

.app-main:focus {
    outline: 0;
}

.app-main .container {
    width: min(100% - 64px, 1180px);
}

.app-main .narrow {
    width: min(100% - 64px, 860px);
}

.partial-loading {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 3;
    height: 3px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.partial-loading span:first-child {
    width: 38%;
    height: 100%;
    display: block;
    background: var(--primary);
    transform: translateX(-110%);
}

.app-main.is-loading .partial-loading {
    opacity: 1;
}

.app-main.is-loading .partial-loading span:first-child {
    animation: partial-loading 1s ease-in-out infinite;
}

@keyframes partial-loading {
    to { transform: translateX(370%); }
}

.sidebar-backdrop {
    display: none;
}

.sidebar-backdrop[hidden],
.js-enabled .sidebar-backdrop[hidden] {
    display: none;
}

.app-main .hero {
    padding: 38px 0;
}

.app-main .hero h1 {
    font-size: clamp(34px, 4vw, 48px);
}

.hero {
    padding: 52px 0 48px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
    gap: 70px;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .13em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 16px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.12;
    letter-spacing: -.055em;
}

h2 {
    margin-bottom: 10px;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.25;
    letter-spacing: -.035em;
}

h3 {
    margin-bottom: 8px;
    font-size: 19px;
    line-height: 1.35;
    letter-spacing: -.015em;
}

.lead {
    max-width: 680px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}

.lookup-form {
    max-width: 720px;
    margin-top: 28px;
}

.lookup-control {
    display: flex;
    gap: 10px;
    padding: 7px;
    background: #fff;
    border: 1px solid #cdd6e5;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(21, 36, 67, .07);
}

.lookup-control:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(21, 94, 239, .1);
}

.lookup-control input {
    min-width: 0;
    flex: 1;
    padding: 12px 14px;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 17px;
}

.lookup-control input::placeholder {
    color: #8a97ac;
}

.lookup-control button,
.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.lookup-control button:hover,
.button-primary:hover {
    background: var(--primary-dark);
}

.form-hint {
    margin: 9px 4px 0;
    color: var(--muted);
    font-size: 13px;
}

.form-error {
    margin: 16px 0 0;
    color: #b42318;
    font-weight: 650;
}

.current-ip-card {
    position: relative;
    padding: 28px;
    overflow: hidden;
    background: #14213d;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.current-ip-card::after {
    content: "";
    position: absolute;
    right: -36px;
    bottom: -52px;
    width: 150px;
    height: 150px;
    border: 28px solid rgba(255, 255, 255, .06);
    border-radius: 50%;
    pointer-events: none;
}

.card-label {
    display: block;
    margin-bottom: 12px;
    color: #aebcda;
    font-size: 13px;
    font-weight: 650;
}

.current-ip {
    position: relative;
    z-index: 1;
    display: block;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(23px, 3vw, 32px);
    line-height: 1.25;
    letter-spacing: -.04em;
}

a.current-ip:hover {
    color: #a9c7ff;
}

.current-ip.unavailable {
    font-size: 22px;
}

.detail-link {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin-top: 14px;
    color: #a9c7ff;
    font-size: 14px;
    font-weight: 700;
}

.current-ip-card .copy-button {
    position: relative;
    z-index: 1;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .16);
}

.current-ip-card .muted {
    color: #aebcda;
}

.current-ip-meta,
.current-ip-asn {
    position: relative;
    z-index: 1;
    display: block;
    color: #c7d5ef;
    font-size: 14px;
}

.current-ip-meta {
    margin-top: 12px;
}

.current-ip-asn {
    margin-top: 2px;
    color: #a9c7ff;
    font-weight: 700;
}

.current-ip-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
}

.current-ip-actions .detail-link {
    margin-top: 0;
}

.my-ip-fields {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0;
    margin: 18px 0 0;
    padding: 10px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .13);
}

.my-ip-fields[hidden],
.my-ip-field[hidden] {
    display: none;
}

.my-ip-field {
    display: grid;
    grid-template-columns: minmax(88px, .8fr) minmax(0, 1.4fr);
    gap: 14px;
    padding: 7px 0;
    font-size: 12px;
}

.my-ip-field dt {
    color: #91a6cb;
}

.my-ip-field dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #e7eefb;
    font-weight: 650;
}

.current-ip-card [aria-disabled="true"],
.current-ip-card button:disabled {
    opacity: .55;
    pointer-events: none;
}

.copy-button {
    min-height: 38px;
    padding: 7px 14px;
    color: #34425d;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-weight: 700;
    cursor: pointer;
}

.copy-button:hover {
    color: var(--primary);
    border-color: #a9c7ff;
}

.copy-button.prominent {
    min-width: 96px;
}

.channel-strip {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.channel-grid a {
    min-width: 0;
    padding: 20px 16px;
    border-right: 1px solid var(--line);
}

.channel-grid a:first-child {
    border-left: 1px solid var(--line);
}

.channel-grid a:hover {
    background: var(--surface-soft);
}

.channel-grid strong,
.channel-grid span {
    display: block;
}

.channel-grid strong {
    margin-bottom: 3px;
    font-size: 15px;
}

.channel-grid span {
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-section,
.page-section {
    padding: 64px 0 80px;
}

.section-heading {
    max-width: 700px;
    margin-bottom: 30px;
}

.section-heading p,
.page-heading p,
.detail-heading p {
    color: var(--muted);
}

.section-heading.compact {
    margin-bottom: 20px;
}

.section-heading.compact h2 {
    font-size: 26px;
}

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

.tool-card {
    min-height: 116px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.tool-card strong {
    font-size: 15px;
}

.tool-card span {
    color: var(--muted);
    font-size: 12px;
}

.breadcrumb {
    margin-bottom: 28px;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: #a6b0c1;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.page-heading {
    margin-bottom: 28px;
}

.page-heading h1,
.detail-heading h1,
.coming-card h1 {
    font-size: clamp(32px, 5vw, 46px);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(21, 36, 67, .05);
}

.query-panel {
    padding: 28px;
}

.query-panel .lookup-form {
    max-width: none;
    margin-top: 0;
}

.notice {
    margin: 22px 0;
    padding: 18px 20px;
    border: 1px solid;
    border-radius: 12px;
}

.notice strong {
    display: block;
    margin-bottom: 3px;
}

.notice p {
    margin-bottom: 0;
    font-size: 14px;
}

.notice.neutral {
    color: #34425d;
    background: #f4f7fb;
    border-color: #dbe2ed;
}

.notice.private {
    color: var(--green);
    background: var(--green-soft);
    border-color: #abefc6;
}

.notice.warning {
    color: var(--amber);
    background: var(--amber-soft);
    border-color: #fedf89;
}

.detail-heading {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: flex-end;
    margin-bottom: 28px;
}

.detail-heading h1 {
    overflow-wrap: anywhere;
}

.detail-heading p {
    margin-bottom: 0;
}

.result-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr);
    gap: 22px;
    align-items: start;
}

.result-panel,
.source-panel {
    padding: 26px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.source-panel h2 {
    margin: 0;
    font-size: 21px;
}

.status-pill {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.status-pill.public {
    color: var(--green);
    background: var(--green-soft);
}

.status-pill.private {
    color: #475467;
    background: #f2f4f7;
}

.result-list {
    margin: 0;
}

.result-list > div {
    display: grid;
    grid-template-columns: 155px minmax(0, 1fr);
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #edf0f5;
}

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

.result-list dt {
    color: var(--muted);
    font-size: 14px;
}

.result-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.result-note {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
}

.source-panel p {
    color: var(--muted);
    font-size: 14px;
}

.source-list {
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.source-list li {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-top: 1px solid #edf0f5;
    font-size: 13px;
}

.source-status {
    color: var(--muted);
    font-style: normal;
    white-space: nowrap;
}

.source-status.ready {
    color: var(--green);
}

.source-status.error {
    color: #b42318;
}

.related-section {
    margin-top: 54px;
}

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

.related-grid div {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.related-grid strong,
.related-grid span {
    display: block;
}

.related-grid strong {
    margin-bottom: 5px;
    font-size: 14px;
}

.related-grid span {
    color: var(--muted);
    font-size: 12px;
}

.coming-card {
    padding: clamp(28px, 6vw, 64px);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.coming-card .lead {
    margin-inline: auto;
}

.coming-card .notice {
    max-width: 560px;
    margin: 28px auto;
    text-align: left;
}

.coming-badge {
    display: inline-block;
    margin-bottom: 18px;
    padding: 5px 10px;
    color: var(--primary);
    background: var(--surface-soft);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    color: #34425d;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-weight: 700;
}

.button-secondary:hover {
    color: var(--primary);
    border-color: #a9c7ff;
}

.error-page {
    min-height: 66vh;
    display: grid;
    place-items: center;
    padding: 80px 0;
    text-align: center;
}

.error-code {
    display: block;
    color: var(--primary);
    font-size: clamp(64px, 12vw, 110px);
    font-weight: 850;
    line-height: 1;
    letter-spacing: -.07em;
}

.error-page h1 {
    margin: 18px 0 12px;
    font-size: 34px;
}

.error-page p {
    color: var(--muted);
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.site-footer {
    padding: 44px 0;
    color: #9ba9c4;
    background: #111b30;
}

.footer-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
}

.footer-brand {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}

.footer-inner p {
    margin: 5px 0 0;
    font-size: 13px;
}

.footer-inner nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13px;
}

.footer-inner a:hover {
    color: #fff;
}

.source-attributions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 22px;
    padding-top: 18px;
    color: #7f8da8;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 11px;
}

.source-attributions a {
    color: #a9c7ff;
}

.ad-slot {
    min-height: 90px;
    margin: 28px 0;
    border: 1px dashed #c8d0dd;
}

@media (max-width: 960px) {
    .workspace-header-inner {
        padding: 0 16px;
    }

    .js-enabled .mobile-menu-button,
    .js-enabled .sidebar-mobile-header button {
        display: grid;
    }

    .workspace-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .tool-sidebar {
        position: static;
        top: auto;
        width: 100%;
        height: auto;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .js-enabled .tool-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 50;
        width: min(86vw, 320px);
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform .18s ease;
        box-shadow: 14px 0 36px rgba(16, 31, 61, .15);
    }

    .js-enabled .tool-sidebar.is-open {
        transform: translateX(0);
    }

    .js-enabled .sidebar-mobile-header {
        min-height: var(--header-height);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px 0 20px;
        border-bottom: 1px solid var(--line);
    }

    .js-enabled .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: block;
        background: rgba(10, 20, 40, .38);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .app-main .container,
    .app-main .narrow {
        width: min(100% - 48px, 1180px);
    }
}

@media (max-width: 920px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 12px 0;
    }

    .main-nav {
        width: 100%;
    }

    .main-nav a:first-child {
        padding-left: 0;
    }

    .hero {
        padding: 42px 0;
    }

    .hero-grid,
    .result-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .current-ip-card {
        max-width: 560px;
    }

    .channel-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 620px) {
    .container,
    .narrow {
        width: min(100% - 24px, 1180px);
    }

    .site-header {
        position: static;
    }

    .workspace-label {
        display: none;
    }

    .header-tool-link {
        padding-inline: 9px;
    }

    .app-main .container,
    .app-main .narrow {
        width: min(100% - 24px, 1180px);
    }

    .hero,
    .content-section,
    .page-section {
        padding-top: 36px;
        padding-bottom: 46px;
    }

    h1 {
        font-size: 38px;
    }

    .lead {
        font-size: 16px;
    }

    .lookup-control {
        display: grid;
        padding: 6px;
    }

    .lookup-control button {
        width: 100%;
    }

    .channel-grid,
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .channel-grid a {
        border-left: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
    }

    .current-ip-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .tool-card {
        min-height: 104px;
    }

    .detail-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-panel,
    .source-panel,
    .query-panel {
        padding: 20px;
    }

    .result-list > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .error-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 390px) {
    .channel-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
