/* Shared V4.2 presentation layer. Existing tool core styles and scripts remain page-owned. */
:root {
  --gt-ink: #17171a;
  --gt-muted: #6f7077;
  --gt-line: #e7e4de;
  --gt-paper: #fbfaf7;
  --gt-card: #fff;
  --gt-accent: #5b4bdb;
  --gt-accent-soft: #eeeaff;
  --gt-max: 1120px;
}
* { box-sizing: border-box; }
.home-page { margin: 0; background: var(--gt-paper); color: var(--gt-ink); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", "Noto Sans SC", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.home-page a { color: inherit; text-decoration: none; }
.home-wrap { max-width: var(--gt-max); margin: auto; padding: 0 16px; }

/* Header */
.home-header { height: 56px; border-bottom: 1px solid var(--gt-line); background: rgba(251,250,247,.92); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.home-nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.home-brand { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.home-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--gt-ink); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 800; }
.home-links { display: flex; align-items: center; gap: 10px; color: var(--gt-muted); font-size: 14px; }
.home-links a { padding: 6px 10px; border-radius: 8px; }
.home-links a:hover { background: #f0eee9; color: var(--gt-ink); }
.home-links .home-language { color: var(--gt-ink); font-weight: 600; }

/* Hero */
.portal-hero { padding: 24px 0 16px; text-align: center; }
.portal-hero h1 { margin: 0 auto; font-size: clamp(34px, 6vw, 48px); font-weight: 800; line-height: 1.2; letter-spacing: -0.03em; }
.portal-hero p { margin: 12px auto 16px; color: var(--gt-muted); font-size: 15px; }
.tool-search { max-width: 500px; margin: auto; position: relative; display: block; }
.tool-search input { width: 100%; height: 50px; border: 1px solid var(--gt-line); border-radius: 14px; background: #fff; padding: 0 20px; font: inherit; font-size: 15px; outline: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.03); transition: border-color 0.2s, box-shadow 0.2s; }
.tool-search input:focus { border-color: var(--gt-accent); box-shadow: 0 0 0 4px var(--gt-accent-soft); }

/* Sections */
.portal-section { padding: 16px 0 32px; }
.portal-section--categories { padding: 0 0 16px; }
.portal-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--gt-line); }
.portal-heading h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.portal-heading span { color: var(--gt-muted); font-size: 13px; }

/* Categories (Horizontal Swipe on Mobile) */
.category-chips { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.category-chips::-webkit-scrollbar { display: none; }
.category-chip { flex-shrink: 0; border: 1px solid var(--gt-line); border-radius: 999px; background: #fff; color: var(--gt-ink); padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.category-chip:hover, .category-chip.is-active { border-color: var(--gt-ink); background: var(--gt-ink); color: #fff; }

/* Tool Grid (App-like Horizontal Cards) */
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card { display: flex; flex-direction: row; align-items: center; gap: 16px; padding: 14px 16px; height: 100%; background: #fff; border: 1px solid var(--gt-line); border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.tool-card:hover { transform: translateY(-2px); border-color: #d2cec4; box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.tool-card:active { transform: scale(0.98); }

/* Featured Accents */
.tool-card--featured-primary { border-color: #ded9f7; background: #fdfcff; }
.tool-card--featured-fun { border-color: #f7e6d9; background: #fffdfc; }

.tool-card__icon { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; color: var(--gt-ink); background: var(--gt-paper); border-radius: 12px; }
.tool-card--featured-primary .tool-card__icon { background: var(--gt-accent-soft); color: var(--gt-accent); }
.tool-card--featured-fun .tool-card__icon { background: #fff4e5; color: #d97706; }

.tool-card__content { display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; }
.tool-card__featured-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; margin-bottom: 4px; }
.tool-card--featured-primary .tool-card__featured-tag { background: var(--gt-accent-soft); color: var(--gt-accent); }
.tool-card--featured-fun .tool-card__featured-tag { background: #fff4e5; color: #d97706; }

.tool-card strong { margin-bottom: 2px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tool-card__desc { color: var(--gt-muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.tool-card__action { color: var(--gt-accent); font-size: 12px; font-style: normal; font-weight: 700; }

.tool-empty { padding: 40px 0; color: var(--gt-muted); text-align: center; }

/* Why Goomni (Compact List) */
.why-grid { display: flex; flex-direction: column; gap: 12px; }
.why-grid article { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; background: #fff; border: 1px solid var(--gt-line); border-radius: 12px; }
.why-grid h3 { margin: 0; font-size: 15px; font-weight: 700; flex-shrink: 0; }
.why-grid p { margin: 0; color: var(--gt-muted); font-size: 14px; line-height: 1.5; }

/* FAQ */
.portal-faq { border-top: 1px solid var(--gt-line); }
.portal-faq details { padding: 16px 0; border-bottom: 1px solid var(--gt-line); }
.portal-faq summary { display: flex; justify-content: space-between; cursor: pointer; font-size: 15px; font-weight: 600; list-style: none; }
.portal-faq summary::-webkit-details-marker { display: none; }
.portal-faq summary::after { content: "+"; color: var(--gt-muted); font-weight: 400; font-size: 18px; }
.portal-faq details[open] summary::after { content: "−"; }
.portal-faq p { margin: 12px 0 0; color: var(--gt-muted); font-size: 14px; line-height: 1.6; }

/* Footer */
.home-footer { padding: 24px 0 40px; border-top: 1px solid var(--gt-line); color: var(--gt-muted); font-size: 13px; }
.footer-top { margin-bottom: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a:hover { color: var(--gt-ink); }

/* Ad Slot Fallback */
.ad-slot[hidden] { display: none !important; }

/* Inner Tool Pages Generic (Keep existing functionality) */
.tool-page-section { max-width: 800px; margin: 0 auto; padding: 52px 16px; }
.tool-page-section h2 { margin: 0 0 14px; font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.03em; }
.tool-page-section p, .tool-page-section li { line-height: 1.75; color: #505158; }
.tool-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tool-feature-grid article, .related-tool-card { border: 1px solid #e7e4de; border-radius: 14px; background: #fff; padding: 18px; }
.tool-feature-grid h3, .related-tool-card strong { display: block; margin: 0 0 7px; font-size: 16px; }
.tool-feature-grid p { margin: 0; font-size: 14px; }
.related-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.related-tool-card { color: inherit; text-decoration: none; transition: border-color .18s, transform .18s; }
.related-tool-card:hover { border-color: #5b50e6; transform: translateY(-1px); }
.related-tool-card span { color: #6f6d68; font-size: 14px; }

@media (min-width: 768px) {
  .home-wrap { padding: 0 28px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why-grid { flex-direction: row; }
  .why-grid article { flex: 1; flex-direction: column; gap: 4px; }
  .footer-top { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
}
@media (min-width: 1024px) {
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-feature-grid, .related-tools { grid-template-columns: 1fr; }
  .tool-page-section { padding: 38px 16px; }
}
