/* Link Preview and SEO Check. Page tokens as /tools/domain/; each app preview has its own fixed colours (.pv-<app>). */
:root {
  --accent: #635bff; --accent-soft: #a594ff; --bg: #ffffff; --card: #f6f9fc; --fg: #0a2540; --muted: #425466; --border: #e3e8ee;
  --accent-fg: #ffffff; --ok: #12805c; --ok-bg: #e3f6ee; --warn: #8a5a00; --warn-bg: #fff3d6; --err: #c0392b; --err-bg: #fde8e5;
  --info: #425466; --info-bg: #eef2f7; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sys: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #a594ff; --accent-soft: #635bff; --bg: #0a2540; --card: #0e2d4a; --fg: #f6f9fc; --muted: #8898aa; --border: #1a3a5c;
    --accent-fg: #0a0a0e; --ok: #4ad9a8; --ok-bg: #0f3a33; --warn: #f0c988; --warn-bg: #3a2e0e; --err: #ff8a76; --err-bg: #43201f;
    --info: #b8c4d2; --info-bg: #17395a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--sys); padding: 16px; }
main { max-width: 1040px; margin: 0 auto; padding: 32px 0 64px; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 24px; font-size: .95rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font-family: var(--mono); font-size: .88em; overflow-wrap: anywhere; }
.muted { color: var(--muted); }

form { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; align-items: flex-start; }
form input[type="text"] { flex: 1; min-width: 180px; font: inherit; font-family: var(--mono); padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--fg); }
form input[type="text"]:focus, select:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; }
button[type="submit"] { font: inherit; font-weight: 600; padding: 10px 18px; border: none; border-radius: 8px; background: var(--accent); color: var(--accent-fg); cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
.btn2 { font: inherit; font-size: .9rem; padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--fg); cursor: pointer; }
.more { flex-basis: 100%; font-size: .9rem; }
.more summary { cursor: pointer; color: var(--muted); }
.more label { display: block; color: var(--muted); margin: 8px 0 4px; font-size: .85rem; }
.more select { font: inherit; font-size: .9rem; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--fg); max-width: 100%; }
label.cb { display: flex; gap: 8px; align-items: flex-start; color: var(--fg); font-size: .9rem; margin: 10px 0 4px; }
label.cb input { margin-top: 4px; }
.hint { font-size: .85rem; color: var(--muted); margin: 6px 0 10px; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 18px; font-size: .88rem; }
.examples .ex { font: inherit; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--fg); cursor: pointer; }
.note { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.c-pass { color: var(--ok); } .c-warn { color: var(--warn); } .c-fail { color: var(--err); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

.summary { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 22px; }
.sum-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sum-head h2 { margin: 0; font-family: var(--mono); font-size: 1.05rem; overflow-wrap: anywhere; min-width: 0; }
.sum-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.counts { margin: 8px 0 0; font-weight: 600; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.counts span { white-space: nowrap; }
.plain h3 { font-size: 1rem; margin: 14px 0 8px; }
.plain p { margin: 6px 0; }
.plainlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plainlist li { display: flex; gap: 10px; align-items: flex-start; }
.plainlist li > div { min-width: 0; overflow-wrap: anywhere; }

.block { margin: 0 0 26px; }
.block > h2 { font-size: 1.15rem; margin: 0 0 4px; }
.badge { display: inline-block; min-width: 46px; text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .04em; border-radius: 6px; padding: 3px 4px; height: fit-content; flex: none; }
.b-pass { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); }
.b-fail { background: var(--err-bg); color: var(--err); } .b-info { background: var(--info-bg); color: var(--info); }

/* checks */
.sec { border: 1px solid var(--border); border-radius: 12px; margin: 12px 0 0; overflow: hidden; }
.sec > h3 { margin: 0; padding: 10px 16px; font-size: 1rem; background: var(--card); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sec > h3 small { font-weight: 500; color: var(--muted); font-size: .85rem; }
.checks { list-style: none; margin: 0; padding: 0; }
.check { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.check:last-child { border-bottom: 0; }
.check .t { font-weight: 600; overflow-wrap: anywhere; }
.check .d { font-size: .9rem; overflow-wrap: anywhere; }
.check .w { color: var(--muted); font-size: .85rem; }
.check .f { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.check .f::before { content: "Fix: "; font-weight: 600; }

/* fix block, tables */
pre.code { font-family: var(--mono); font-size: .82rem; line-height: 1.5; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
details.tech, details.about { margin: 16px 0; }
details.tech > summary, details.about > summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
details.about { font-size: .9rem; color: var(--muted); }
details.about ul { padding-left: 20px; } details.about li { margin: 0 0 6px; }
.tsec { margin: 10px 0 18px; }
.tsec h3 { font-size: .98rem; margin: 0 0 6px; }
.tw { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .82rem; }
th, td { text-align: left; vertical-align: top; padding: 5px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td { font-family: var(--mono); overflow-wrap: anywhere; word-break: break-word; min-width: 60px; }
td.diff { color: var(--warn); font-weight: 600; }
.chain { font-family: var(--mono); font-size: .82rem; margin: 6px 0; padding-left: 22px; overflow-wrap: anywhere; }

footer { margin-top: 40px; font-size: .85rem; color: var(--muted); }
footer p { margin: 0 0 8px; }
footer hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* ---------------------------------------------------------------- previews */
.pv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.pv { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--card); min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pv-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .85rem; font-weight: 700; }
.pv-label .tag { font-weight: 500; color: var(--muted); font-size: .78rem; }
.pv-basis { font-size: .78rem; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.pv-stage { border-radius: 10px; padding: 12px; overflow: hidden; }
.cl1, .cl2, .cl3, .cl4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cl1, .cl2, .cl3, .cl4 { align-self: start; }
.cl1 { -webkit-line-clamp: 1; line-clamp: 1; } .cl2 { -webkit-line-clamp: 2; line-clamp: 2; } .cl3 { -webkit-line-clamp: 3; line-clamp: 3; } .cl4 { -webkit-line-clamp: 4; line-clamp: 4; }
.pv img { display: block; max-width: 100%; }
.im-wide { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; background: #ccd3dc; }
.im-sq { width: 80px; height: 80px; object-fit: cover; flex: none; background: #ccd3dc; }
.noimg { display: flex; align-items: center; justify-content: center; color: #6b7785; font-size: .8rem; background: repeating-linear-gradient(45deg, #e9edf2, #e9edf2 8px, #f3f5f8 8px, #f3f5f8 16px); }
.fav { width: 16px; height: 16px; border-radius: 3px; flex: none; object-fit: contain; }
.host { font-size: .8rem; }

/* Slack: white message, grey bar on the left */
.pv-slack .pv-stage { background: #fff; color: #1d1c1d; font: 15px/1.46 var(--sys); }
.sl { border-left: 4px solid #dddddd; padding-left: 12px; display: grid; gap: 4px; }
.sl-site { display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: 13px; color: #1d1c1d; }
.sl-title { color: #1264a3; font-weight: 700; }
.sl-row { display: flex; gap: 12px; align-items: flex-start; }
.sl-row > div { min-width: 0; flex: 1; }
.sl .im-wide { max-width: 360px; border-radius: 8px; margin-top: 4px; }
.sl .im-sq { width: 72px; height: 72px; border-radius: 6px; }
.sl-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 13px; }
.sl-fields b { display: block; }

/* Microsoft Teams: card with a border */
.pv-teams .pv-stage { background: #f5f5f5; color: #242424; font: 14px/1.43 "Segoe UI", var(--sys); }
.tm { background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; max-width: 420px; }
.tm-body { padding: 10px 12px; display: grid; gap: 2px; }
.tm-title { font-weight: 600; }
.tm-desc { color: #424242; font-size: 13px; }
.tm-host { color: #616161; font-size: 12px; }
.tm-row { display: flex; gap: 0; }
.tm-row .im-sq { width: 96px; height: auto; min-height: 96px; }

/* X */
.pv-x .pv-stage { background: #fff; color: #0f1419; font: 15px/1.3 var(--sys); }
.xl { border: 1px solid #cfd9de; border-radius: 16px; overflow: hidden; position: relative; }
.xl .im-wide { aspect-ratio: 1.91 / 1; }
.xl-over { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); background: rgba(0,0,0,.77); color: #fff; font-size: 13px; padding: 1px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-from { color: #536471; font-size: 13px; margin-top: 4px; }
.xs { border: 1px solid #cfd9de; border-radius: 16px; overflow: hidden; display: flex; }
.xs .im-sq { width: 130px; height: 130px; border-right: 1px solid #cfd9de; }
.xs-body { padding: 10px 12px; display: grid; gap: 2px; align-content: center; min-width: 0; font-size: 14px; }
.xs-host, .xs-desc { color: #536471; }

/* LinkedIn */
.pv-linkedin .pv-stage { background: #f4f2ee; color: rgba(0,0,0,.9); font: 14px/1.42 var(--sys); }
.li { background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid #e0dfdc; }
.li-body { padding: 8px 12px; background: #eef3f8; display: grid; gap: 2px; }
.li-title { font-weight: 600; }
.li-host { color: rgba(0,0,0,.6); font-size: 12px; }
.li-row { display: flex; gap: 10px; align-items: center; padding: 8px; background: #fff; }
.li-row .im-sq { width: 64px; height: 64px; border-radius: 4px; }

/* Facebook */
.pv-facebook .pv-stage { background: #fff; color: #050505; font: 15px/1.33 Helvetica, Arial, var(--sys); }
.fb { border: 1px solid #dadde1; overflow: hidden; }
.fb-body { background: #f0f2f5; padding: 10px 12px; display: grid; gap: 3px; }
.fb-host { color: #65676b; font-size: 12px; text-transform: uppercase; }
.fb-title { font-weight: 600; font-size: 16px; }
.fb-desc { color: #65676b; font-size: 14px; }
.fb-row { display: flex; }
.fb-row .im-sq { width: 120px; height: auto; min-height: 120px; }

/* WhatsApp: outgoing bubble */
.pv-whatsapp .pv-stage { background: #efeae2; color: #111b21; font: 14px/1.4 var(--sys); }
.wa { background: #d9fdd3; border-radius: 8px; padding: 4px; max-width: 360px; margin-left: auto; }
.wa-card { background: #d1f4cc; border-radius: 6px; overflow: hidden; }
.wa-row { display: flex; gap: 0; }
.wa-row .im-sq { width: 84px; height: auto; min-height: 84px; }
.wa-body { padding: 6px 10px; display: grid; gap: 2px; min-width: 0; }
.wa-title { font-weight: 600; }
.wa-desc, .wa-host { color: #54656f; font-size: 13px; }
.wa-link { color: #027eb5; font-size: 14px; padding: 4px 6px 2px; overflow-wrap: anywhere; }

/* Discord: dark, theme-color stripe */
.pv-discord .pv-stage { background: #313338; color: #dbdee1; font: 15px/1.375 var(--sys); }
.dc { background: #2b2d31; border-left: 4px solid #1e1f22; border-radius: 4px; padding: 10px 14px 14px 12px; max-width: 432px; display: grid; gap: 6px; }
.dc-site { font-size: 12px; color: #dbdee1; }
.dc-title { color: #00a8fc; font-weight: 600; font-size: 15px; }
.dc-desc { font-size: 14px; color: #dbdee1; }
.dc-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.dc-row > div { min-width: 0; display: grid; gap: 6px; }
.dc .im-wide { border-radius: 4px; aspect-ratio: auto; max-height: 260px; object-fit: contain; background: transparent; }
.dc .im-sq { border-radius: 4px; }

/* Telegram */
.pv-telegram .pv-stage { background: #c8d7a9; background: linear-gradient(135deg, #d1dbb0, #9fbf8f); color: #000; font: 14px/1.35 var(--sys); }
.tg { background: #effdde; border-radius: 12px; padding: 6px 8px 8px; max-width: 380px; margin-left: auto; }
.tg-link { color: #168acd; overflow-wrap: anywhere; margin: 0 0 4px; }
.tg-card { border-left: 3px solid #4fae4e; padding: 2px 0 2px 8px; display: grid; gap: 2px; border-radius: 2px; }
.tg-site { color: #4fae4e; font-weight: 600; font-size: 13px; }
.tg-title { font-weight: 600; }
.tg-row { display: flex; gap: 8px; }
.tg-row > div { min-width: 0; flex: 1; display: grid; gap: 2px; }
.tg .im-wide { border-radius: 6px; margin-top: 4px; }
.tg .im-sq { width: 56px; height: 56px; border-radius: 6px; }

/* iMessage */
.pv-imessage .pv-stage { background: #fff; color: #000; font: 15px/1.3 -apple-system, var(--sys); }
.im { border-radius: 18px; overflow: hidden; max-width: 300px; margin-left: auto; background: #e9e9eb; }
.im-body { padding: 8px 12px 10px; display: grid; gap: 1px; }
.im-title { font-weight: 600; font-size: 14px; }
.im-host { color: #8a8a8e; font-size: 13px; }
.im-row { display: flex; gap: 8px; align-items: center; padding: 8px 12px; }
.im-row .im-sq { width: 40px; height: 40px; border-radius: 8px; }

/* Notion */
.pv-notion .pv-stage { background: #fff; color: #37352f; font: 14px/1.5 ui-sans-serif, var(--sys); }
.nb { display: flex; border: 1px solid rgba(55,53,47,.16); border-radius: 4px; overflow: hidden; min-height: 106px; }
.nb-body { padding: 12px 14px; flex: 4 1 180px; min-width: 0; display: grid; gap: 4px; align-content: start; }
.nb-title { font-size: 14px; }
.nb-desc { font-size: 12px; color: rgba(55,53,47,.65); }
.nb-url { display: flex; gap: 6px; align-items: center; font-size: 12px; min-width: 0; }
.nb-url span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-img { flex: 1 1 140px; max-width: 250px; position: relative; }
.nb-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.n-embed { margin-top: 8px; font-size: 12px; color: rgba(55,53,47,.65); }

/* Google search result */
.pv-google .pv-stage { background: #fff; color: #4d5156; font: 14px/1.58 Arial, var(--sys); }
.gg-site { display: flex; gap: 10px; align-items: center; }
.gg-ic { width: 28px; height: 28px; border-radius: 50%; background: #f1f3f4; border: 1px solid #ecedef; display: flex; align-items: center; justify-content: center; flex: none; }
.gg-ic img { width: 18px; height: 18px; object-fit: contain; }
.gg-name { color: #202124; font-size: 14px; line-height: 20px; }
.gg-url { color: #4d5156; font-size: 12px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gg-site > div { min-width: 0; }
.gg-title { color: #1a0dab; font-size: 20px; line-height: 26px; margin: 4px 0 2px; overflow-wrap: anywhere; }
.gg-desc { overflow-wrap: anywhere; }

.pv-warn { font-size: .78rem; color: var(--warn); margin: 0; }

@media (max-width: 760px) { .pv-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  main { padding-top: 12px; }
  .check { grid-template-columns: 46px minmax(0, 1fr); padding: 10px 12px; gap: 8px; }
  .sec > h3 { padding: 10px 12px; }
  form input[type="text"] { min-width: 0; flex-basis: 100%; }
  button[type="submit"] { width: 100%; }
  .xs .im-sq { width: 96px; height: 96px; }
  .pv-stage { padding: 10px; }
}
