* {margin: 0; padding: 0; box-sizing: border-box;}

html {font-size: 16px; scroll-behavior: smooth;}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: #333;
background-color: #fff;
}

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

header {
background: linear-gradient(135deg, #2c3e50, #34495e);
color: white;
padding: 1rem 0;
border-bottom: 3px solid #3498db;
}

header h1 {
font-size: 1.8rem;
text-align: center;
margin-bottom: 0.5rem;
}

nav {
display: flex;
justify-content: center;
gap: 1.5rem;
flex-wrap: wrap;
}

nav a {
color: #ecf0f1;
text-decoration: none;
font-weight: 500;
padding: 0.25rem 0;
border-bottom: 2px solid transparent;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
transparency: 0.8;
tr

nav a:hover {
color: #fff;
border-bottom-color: #3498db;
}

main {
padding: 2rem 0;
}

.hero {
background: linear-gradient(135deg, #f8f9fa, #e9ecef);
padding: 2rem 0;
margin-bottom: 2rem;
border-radius: 8px;
margin: 1rem 0;
border: 1px solid #e0e0e0;
}

.hero h2 {
font-size: 2rem;
text-align: center;
margin-bottom: 0.5rem;
color: #2c3e50;
}

.hero p {
text-align: center;
color: #555;
margin-bottom: 1.5rem;
}

.tool-form {
max-width: 600px;
margin: 0 auto;
background: white;
padding: 1.5rem;
border-radius: 8px;
shadow: 0 2px 10px rgba(0,0,0,0.1);
border: 1px solid #e0e0e0;
}

.form-group {
margin-bottom: 1.5rem;
}

.form-group label {
display: block;
font-weight: 600;
margin-bottom: 0.5rem;
color: #2c3e50;
}

.form-group input,
.form-group select {
width: 100%;
padding: 0.75rem;
border: 2px solid #ddd;
border-radius: 6px;
font-size: 1rem;
font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
border-color: #3498db;
outline: none;
shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-row {
display: flex;
gap: 1rem;
flex-wrap: wrap;
}

.form-row .form-group {
flex: 1;
min-width: 200px;
}

.unit {
font-size: 0.85rem;
color: #666;
margin-left: 0.5rem;
}

.preset-select {
text-align: center;
}

.presets {
display: flex;
gap: 0.5rem;
justify-content: center;
flex-wrap: wrap;
}

.preset-btn {
background: #f0f0f0;
border: 1px solid #ccc;
border-radius: 20px;
padding: 0.5rem 1rem;
cursor: pointer;
transition: all 0.2s;
}

.preset-btn:hover,
.preset-btn.active {
background: #3498db;
color: white;
border-color: #2980b9;
}

.calc-button {
display: block;
width: 100%;
padding: 1rem;
background: linear-gradient(135deg, #3498db, #2980b9);
color: white;
border: none;
border-radius: 8px;
font-size: 1.1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}

.calc-button:hover {
shadow: 0 2px 15px rgba(52, 152, 219, 0.4);
}

.results-section {
background: white;
padding: 2rem;
border-radius: 8px;
border: 1px solid #e0e0e0;
margin-bottom: 2rem;
}

.results-section h2 {
margin-bottom: 1rem;
color: #2c3e50;
}

.result-card {
background: #f8f9fa;
padding: 1.5rem;
border-radius: 8px;
margin-bottom: 1.5rem;
border-left: 4px solid #3498db;
}

.result-card h3 {
margin-bottom: 1rem;
color: #2c3e50;
}

.cost-comparison {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 1rem;
margin: 1rem 0;
}

.cost-item {
text-align: center;
padding: 1rem;
background: white;
border-radius: 6px;
}

.method {
font-weight: 600;
color: #2c3e50;
margin-bottom: 0.5rem;
}

.cost {
font-size: 1.5rem;
font-weight: 700;
color: #3498db;
}

.note {
font-size: 0.85rem;
color: #666;
margin-top: 0.25rem;
}\n
.actions {
display: flex;
gap: 0.5rem;
margin-top: 1rem;
}

.action-btn {
padding: 0.5rem 1rem;
background: #e0e0e0;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background 0.2s;
}

.action-btn:hover {
background: #ccc;
}

.saved-results {
margin-top: 2rem;
padding-top: 2rem;
top: 2rem;
border-top: 2px solid #e0e0e0;
}

.saved-results h3 {
margin-bottom: 1rem;
color: #2c3e50;
}

.saved-list {
list-style: none;
}

.saved-list li {
padding: 0.75rem;
background: #f8f9fa;
border-radius: 4px;
margin-bottom: 0.5rem;
display: flex;
justify-content: space-between;
align-items: center;
}

.usage-guide,
.community-sharing {
background: white;
padding: 1.5rem;
border-radius: 8px;
border: 1px solid #e0e0e0;
margin-bottom: 2rem;
}

.usage-guide h2,
.community-sharing h2 {
margin-bottom: 1rem;
color: #2c3e50;
}

.usage-guide h3,
.community-sharing h3 {
margin: 1rem 0 0.5rem;
color: #34495e;
}

.usage-guide ul,
.community-sharing ul {
margin-left: 1.5rem;
margin-bottom: 1rem;
}

.example-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1rem;
margin: 1rem 0;
}

.example-card {
background: #f8f9fa;
padding: 1rem;
border-radius: 6px;
border: 1px solid #e0e0e0;
}

.example-card h4 {
margin-bottom: 0.5rem;
color: #2c3e50;
}

.example-card p {
font-size: 0.9rem;
}

footer {
background: #2c3e50;
color: #ecf0f1;
padding: 1rem 0;
border-top: 3px solid #3498db;
margin-top: 2rem;
}

footer a {
color: #3498db;
text-decoration: none;
}

footer a:hover {
color: #fff;
text-decoration: underline;
}

@media (max-width: 768px) {
.form-row {
flex-direction: column;
}

.container {
padding: 0 0.5rem;
}

.hero h2 {
font-size: 1.5rem;
}

.tool-form {
padding: 1rem;
}

.results-section {
padding: 1rem;
}

.usage-guide,
.community-sharing {
padding: 1rem;
}

.example-grid {
grid-template-columns: 1fr;
}
}

@media (max-width: 480px) {
nav {
flex-direction: column;
gap: 0.5rem;
}

.presets {
flex-direction: column;
align-items: center;
}

.actions {
flex-direction: column;
}
}

.results-hidden {
display: none;
}

#result-tool {
color: #3498db;
font-weight: 600;
}

#best-option {
color: #27ae60;
font-weight: 700;
}

.cost-item.borrow .cost {
color: #27ae60;
}

.cost-item.rent .cost {
color: #e67e22;
}

.cost-item.buy .cost {
color: #3498db;
}

.ad-slot-marker {
text-align: center;
margin: 1rem 0;
padding: 1rem;
background: #f8f9fa;
border: 1px dashed #ccc;
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
