:root {
  --primary-color: #0d9488;
  /* Teal-600 */
  --primary-hover: #0f766e;
  /* Teal-700 */
  --secondary-color: #1f2937;
  /* Gray-800 */
  --accent-color: #ef4444;
  /* Red-500 */
  --bg-color: #f3f4f6;
  /* Gray-100 */
  --card-bg: #ffffff;
  --text-color: #374151;
  /* Gray-700 */
  --border-color: #e5e7eb;
  /* Gray-200 */
  --border-radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --font-main: "Inter", "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Typography Optimization */
  line-break: strict;
  /* Better punctuation handling for JA */
  overflow-wrap: anywhere;
  /* Prevent horizontal overflow */
}

h1,
h2,
h3 {
  color: var(--secondary-color);
  margin-top: 0;
  line-height: 1.3;
  /* Prevent awkward breaks in headers */
  text-wrap: balance;
  word-break: auto-phrase;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.container {
  width: 92%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 641px) {
  .nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.logo a {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary-color);
  text-decoration: none;
}

/* Nav Scroll Container (Mobile) */
.nav-scroll-container {
  position: relative;
  overflow: hidden;
}

/* Mobile: Fade effect on right */
@media (max-width: 640px) {
  .nav-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 32px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
  }
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Mobile Scroll Nav */
@media (max-width: 640px) {
  .nav-flex {
    display: block;
    /* Stack logo and nav vertically */
  }

  .logo {
    padding-bottom: 0.5rem;
  }

  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 5px;
    /* Space for scrollbar if visible */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
  }

  nav::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
  }

  nav ul {
    display: inline-flex;
    gap: 1.5rem;
    padding-right: 2rem;
    /* Ensure last item is reachable */
  }

  nav a {
    display: inline-block;
    padding: 0.5rem 0;
    /* Min height tap target help */
    font-size: 0.95rem;
  }
}

nav a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

/* Main Content */
main {
  padding: 3rem 0;
  min-height: 80vh;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.btn:hover {
  background-color: var(--primary-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.2);
}

/* Tools Grid (Scoped to Home) */
.home .tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.home .tools-grid li {
  display: flex;
}

.home .tool-card-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.home .tool-card-link:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-2px);
}

.home .tool-card-link strong {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Guide List */
.guide-list {
  display: grid;
  gap: 1.5rem;
}

.guide-item {
  border: 1px solid #e5e7eb;
  /* Subtle Gray-200 */
  border-radius: var(--border-radius);
  background: white;
  transition: all 0.25s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.guide-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  border-color: #cbd5e1;
  /* Slightly darker gray on hover, not full primary */
}

/* Header - Clean, no background, unified with body */
.guide-header {
  background-color: transparent;
  padding: 2rem 2rem 0.5rem 2rem;
  /* Initial padding, less bottom */
  border-bottom: none;
}

.guide-header h2 {
  margin: 0;
  border: none;
  font-size: 1.35rem;
  /* Slightly larger */
  line-height: 1.4;
}

.guide-header h2 a {
  color: #111827;
  /* Gray-900 for strong title */
  text-decoration: none;
  font-weight: 700;
  display: block;
}

.guide-header h2 a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

/* Body - Good flow from header */
.guide-body {
  padding: 0.5rem 2rem 2.5rem 2rem;
  /* Less top padding */
  display: flex;
  flex-direction: column;
  flex: 1;
}

.guide-body p {
  color: #4b5563;
  /* Gray-600 */
  margin-bottom: 2rem;
  line-height: 1.75;
  /* Relaxed reading experience */
  font-size: 0.95rem;
  flex-grow: 1;
}

/* Action Button - Polished "Ghost" or "Text" style with arrow */
.guide-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.5rem;
  border-radius: 99px;
  /* Pill shape for modern feel */
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.guide-btn::after {
  content: "→";
  margin-left: 0.5rem;
  transition: transform 0.2s;
}

.guide-btn:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.15);
}

.guide-btn:hover::after {
  transform: translateX(4px);
}

/* FAQ */
.faq-section {
  background-color: white;
}

.faq-section details {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.faq-section details:last-child {
  border-bottom: none;
}

.faq-section summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

.faq-section summary::-webkit-details-marker {
  display: none;
}

.faq-section summary::after {
  content: "+";
  position: absolute;
  right: 0;
  font-weight: normal;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--primary-color);
}

.faq-section details[open] summary::after {
  content: "−";
}

.faq-section p {
  margin-top: 1rem;
  margin-bottom: 0;
  color: #4b5563;
  padding-left: 1rem;
  border-left: 2px solid var(--border-color);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Footer */
footer {
  background-color: #0f172a;
  /* Slate-900 */
  color: #94a3b8;
  /* Slate-400 */
  padding: 3rem 0;
  text-align: center;
  font-size: 0.9rem;
}

footer a {
  color: #cbd5e1;
  /* Slate-300 */
}

footer a:hover {
  color: white;
}

/* Mobile */
@media (max-width: 640px) {
  .nav-flex {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    gap: 1rem;
    font-size: 0.9rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .home .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Tool Card Link - Overrides or Extensions */
@media (max-width: 640px) {
  .home .tool-card-link {
    padding: 1.25rem;
    min-height: 80px;
    align-items: center;
    /* Center text vertically if needed */
    flex-direction: row;
    /* Ensure icon is to the right if we had one, but currently text only */
    display: flex;
    justify-content: space-between;
  }

  .home .tool-card-link::after {
    content: '→';
    font-weight: bold;
    color: var(--primary-color);
    opacity: 0.7;
  }
}

/* Recommended Grid */
.recommended-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.recommended-card {
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-color);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
  display: block;
}

.recommended-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background-color: #f0fdfa;
  /* Teal-50 */
  text-decoration: none;
}

.recommended-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.recommended-desc {
  display: block;
  font-size: 0.85rem;
  color: #4b5563;
}

/* Details Accordion for Other Tools (Scoped to Home) */
.home .tools-accordion {
  width: 100%;
}

.home .tools-accordion summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1rem;
  background: #f3f4f6;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--secondary-color);
}

.home .tools-accordion summary::-webkit-details-marker {
  display: none;
}

.home .tools-accordion summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--primary-color);
  line-height: 1;
}

.home .tools-accordion[open] summary::after {
  content: "−";
}

/* Homepage specific accordion spacing */
.home-tools-fold {
  margin-bottom: 3rem;
}


/* Mobile tweaks for header nav flex in header block above */


/* Utility */
/* Utility */
.breadcrumbs {
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  color: #6b7280;
}

.breadcrumbs li a {
  color: #6b7280;
  /* Gray-500 */
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  display: flex;
  /* For alignment */
  align-items: center;
}

.breadcrumbs li a:hover {
  color: var(--primary-color);
  background-color: #f0fdfa;
  /* Teal-50 */
  border-radius: 4px;
}

/* Add separator via CSS except for last item */
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: #d1d5db;
  /* Gray-300 */
  font-weight: normal;
  font-size: 0.9em;
}

/* Current page item */
.breadcrumbs li:last-child span[aria-current="page"] {
  color: var(--secondary-color);
  font-weight: 600;
}

.disclaimer {
  background-color: #fff7ed;
  /* Orange-50 */
  border: 1px solid #fed7aa;
  /* Orange-200 */
  color: #9a3412;
  /* Orange-800 */
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* =========================================================================
   Scoped styles for Calculation Pages (.calc-page)
   Optimized for Mobile & Readability
   ========================================================================= */

/* Typography & Layout Scoping */
.calc-page {
  /* Ensure no unexpected resets */
}

.calc-page p,
.calc-page li {
  font-size: 1rem;
  /* Base 16px */
  line-height: 1.75;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.calc-page .card {
  line-height: 1.75;
  padding: 2rem;
}

/* Form inputs optimizations */
.calc-page input[type="number"],
.calc-page input[type="text"],
.calc-page select {
  font-size: 16px;
  /* Prevents iOS zoom */
  min-height: 48px;
  /* Touch target size */
  padding: 0.75rem 1rem;
}

.calc-page .btn {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
}

/* Result Box Styles Scoped */
.calc-page .result-box--standard {
  padding: 2rem;
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, .10);
  border-left: 6px solid var(--primary-color);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 20px rgba(17, 24, 39, .06);
}

.calc-page .result-total-value {
  color: var(--primary-color);
  font-weight: 800;
  font-size: 2.5rem;
}

.calc-page .result-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 0.25rem;
}

.calc-page .result-label {
  font-weight: 500;
}

.calc-page .result-value {
  font-family: monospace;
  font-weight: 600;
}

.calc-page .result-placeholder {
  padding: 3rem;
  text-align: center;
  background: #f9fafb;
  border: 2px dashed #e5e7eb;
  border-radius: 8px;
  color: #9ca3af;
}

/* Calculation Layout (Flex) */
.calc-page .calc-wrap {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.calc-page .calc-form {
  flex: 1;
  min-width: 0;
  /* Prevent flex overflow */
}

.calc-page .calc-result {
  width: 380px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  /* Below header */
}

/* Article Content Styles */
.article-highlight-box {
  background-color: #f0fdfa;
  /* Teal-50 */
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  margin: 1.5rem 0;
}

/* =========================================================================
   Guide Content Styling (Readability Focused)
   ========================================================================= */

.guide-content h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--border-color);
  line-height: 1.4;
}

.guide-content .lead {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #1f2937;
  /* Darker for emphasis */
  margin-bottom: 2.5rem;
  font-weight: 500;
}

.guide-content h2 {
  font-size: 1.5rem;
  background: #f3f4f6;
  /* Gray-100 */
  padding: 0.75rem 1rem;
  border-left: 5px solid var(--primary-color);
  border-bottom: none;
  /* Override default */
  border-radius: 4px;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

.guide-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.guide-content p {
  margin-bottom: 1.75rem;
  line-height: 1.9;
  /* Relaxed line-height */
  font-size: 1.05rem;
  /* Slightly larger base */
  letter-spacing: 0.02em;
  color: #374151;
  /* Gray-700 */
}

.guide-content li {
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

/* Highlight Boxes */
.highlight-box {
  background-color: #f0fdfa;
  /* Teal-50 */
  border: 1px solid #ccfbf1;
  /* Teal-100 */
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.highlight-box strong {
  display: block;
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--primary-color);
  padding-bottom: 0.25rem;
}

/* Alert/Warning Box */
.alert-box {
  background-color: #fef2f2;
  /* Red-50 */
  border: 1px solid #fee2e2;
  /* Red-100 */
  border-left: 4px solid #ef4444;
  /* Red-500 */
  border-radius: 4px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.alert-box strong {
  display: block;
  color: #b91c1c;
  /* Red-700 */
  margin-bottom: 0.5rem;
}

/* Point/Check Box */
.point-box {
  background-color: #fff7ed;
  /* Orange-50 */
  border: 2px solid #ffedd5;
  /* Orange-100 */
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  position: relative;
}

.point-box::before {
  content: 'POINT';
  position: absolute;
  top: -12px;
  left: 1rem;
  background: #f97316;
  /* Orange-500 */
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 2px 10px;
  border-radius: 12px;
}

/* Table of Contents */
.toc {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 3rem;
}

.toc h2 {
  font-size: 1.1rem;
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.toc ul {
  padding-left: 1.5rem;
  margin: 0;
}

.toc li {
  margin-bottom: 0.5rem;
  list-style-type: decimal;
}

.toc a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
}

.toc a:hover {
  text-decoration: underline;
  color: var(--primary-color);
}

.article-highlight-box p+p {
  margin-top: 0.5rem;
}

.article-highlight-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.article-formula-box {
  background-color: #f3f4f6;
  /* Gray-100 */
  padding: 2rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  text-align: center;
  border: 1px solid #e5e7eb;
}

.article-formula {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.article-warning-box {
  background-color: #fffbeb;
  /* Amber-50 */
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #fcd34d;
  /* Amber-300 */
  margin: 1.5rem 0;
}

.article-warning-box ul {
  margin: 0;
  padding-left: 1.5rem;
}

.article-step {
  margin-bottom: 1.5rem;
}

.article-step strong {
  display: block;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.article-check-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.article-check-list li {
  background-color: #f0fdfa;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

/* Mobile Responsive Scoped */
@media (max-width: 900px) {
  .calc-page .calc-wrap {
    flex-direction: column;
    gap: 2rem;
  }

  .calc-page .calc-form {
    width: 100%;
    order: 1;
    /* Main content first */
  }

  .calc-page .calc-result {
    width: 100%;
    position: static;
    order: 2;
    /* Sidebar/Result last */
    margin-top: 1rem;
  }

  .calc-page .btn {
    width: 100%;
    /* Full width button on mobile */
    justify-content: center;
  }

  .calc-page .card {
    padding: 1.5rem;
    /* Slightly reduced padding on mobile */
  }

  .calc-page h1 {
    font-size: 1.75rem;
    /* Smaller H1 */
  }
}

/* Branding Sub-text */
.brand-sub {
  font-size: 0.75rem;
  color: #6b7280;
  /* Gray-500 */
  font-weight: normal;
  margin-left: 0.5rem;
}

/* =========================================================================
   Unified Calculator Page Specifics
   ========================================================================= */

/* Mode Switcher */
.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.mode-btn {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--secondary-color);
  padding: 0.75rem 1rem;
  border-radius: 99px;
  /* Pill shape */
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

.mode-btn.is-active {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Next Steps Section */
.next-steps {
  background-color: #f8fafc;
  /* Slate-50 */
  border: 1px solid #e2e8f0;
  /* Slate-200 */
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.checklist {
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}

.checklist li {
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--secondary-color);
}

.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* Left align */
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s;
  height: 100%;
  /* Fill grid height */
}

.link-card strong {
  color: var(--primary-color);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: block;
  width: 100%;
}

.link-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

/* Unified Page Mobile Optimization */
.calc-page--unified .calc-details {
  /* Details moved down in DOM, just ensure spacing */
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

@media (max-width: 900px) {

  /* Ensure result is close to form on mobile */
  .calc-page--unified .calc-wrap {
    gap: 1.5rem;
  }

  .calc-page--unified .calc-result {
    margin-top: 0;
  }

  /* Taller buttons for touch */
  .mode-btn {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* =========================================================================
   Guide Grid System (Added for Redesign)
   ========================================================================= */

.guide-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  /* Responsive Grid */
  gap: 2rem;
  margin-bottom: 4rem;
}

/* Base Guide Card (Redesigned) */
.guide-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  height: 100%;
  /* Uniform height */
}

.guide-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

/* Header tweaks for card */
.guide-item .guide-header {
  background: transparent;
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  border: none;
}

.guide-item .guide-header h2 {
  font-size: 1.15rem;
  border: none;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  background: none;
}

.guide-item .guide-header h2 a {
  color: #111827;
  text-decoration: none;
}

.guide-item .guide-header h2 a:hover {
  color: var(--primary-color);
}

.guide-item .guide-body {
  padding: 0.5rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.guide-item .guide-body p {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Tags */
.guide-tags {
  margin-bottom: 0.75rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
}

.tag--basic {
  background: #e0f2fe;
  color: #0369a1;
}

/* Blue */
.tag--legal {
  background: #fef3c7;
  color: #b45309;
}

/* Amber */
.tag--calc {
  background: #dcfce7;
  color: #15803d;
}

/* Green */
.tag--check {
  background: #f3e8ff;
  color: #7e22ce;
}

/* Purple */
.tag--column {
  background: #f3f4f6;
  color: #4b5563;
}

/* Gray */

/* Featured Card (Spans full width) */
.guide-item.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: linear-gradient(to right bottom, #ffffff, #fcfcfc);
  border: 1px solid var(--primary-color);
  box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.1);
}

.guide-item.featured .guide-header {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.guide-item.featured .guide-body {
  padding: 3rem;
  background: none;
  justify-content: center;
  border-left: 1px dashed #e5e7eb;
}

.guide-item.featured h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.guide-item.featured p {
  font-size: 1rem;
}

/* Responsive Featured Card */
@media (max-width: 768px) {
  .guide-item.featured {
    grid-template-columns: 1fr;
  }

  .guide-item.featured .guide-header,
  .guide-item.featured .guide-body {
    padding: 1.5rem;
    border-left: none;
  }
}

/* Guide Intro Features (Redesigned) */
.guide-intro {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  margin: 2rem 0 4rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.guide-intro-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
}

.guide-intro-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

.guide-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.intro-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: #f0fdfa;
  /* Teal-50 */
  color: var(--primary-color);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  font-weight: bold;
}

.feature-title {
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.feature-desc {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

/* =========================================================================
   Homepage Premium Redesign
   ========================================================================= */

/* Hero Section */
.home-hero {
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 60%, #fefce8 100%);
  padding: 4rem 1rem 5rem;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.home-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  color: #111827;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #4b5563;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.hero-btn {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1rem 3rem;
  border-radius: 99px;
  text-decoration: none;
  box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(13, 148, 136, 0.4);
}

/* Section Common */
.home-section {
  padding: 4rem 0;
}

.section-title {
  font-size: 1.5rem;
  text-align: center;
  color: #111827;
  margin-bottom: 3rem;
  position: relative;
  font-weight: 700;
  border: none;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* Tool Grid (Calculator Navigation) */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  display: block;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 2rem;
  text-decoration: none;
  transition: all 0.3s;
  text-align: center;
}

.tool-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
}

.tool-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.tool-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.tool-desc {
  display: block;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Trust Signals */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  background: #f8fafc;
  border-radius: 24px;
  padding: 3rem;
}

.trust-item {
  text-align: center;
}

.trust-icon {
  width: 64px;
  height: 64px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

.trust-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.trust-desc {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .home-hero h1 {
    font-size: 2rem;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
}