/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #222; background: #f4f7f6; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.skip-to-main { position: absolute; top: -40px; left: 0; background: #0b7a75; color: #fff; padding: 8px 16px; text-decoration: none; }
.skip-to-main:focus { top: 0; }

header { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
.logo a { font-weight: 700; font-size: 1.25rem; color: #0b7a75; text-decoration: none; }
nav { display: flex; gap: 16px; }
nav a { color: #444; text-decoration: none; font-weight: 500; }
nav a:hover { color: #0b7a75; }

.intro { background: linear-gradient(135deg, #0b7a75, #0a5e5a); color: #fff; padding: 48px 0 32px; text-align: center; }
.intro h1 { font-size: 2rem; margin-bottom: 8px; }
.intro .version { font-size: 0.85rem; opacity: 0.8; }

.calculator { padding: 40px 0; }
.calculator-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 768px) {
  .calculator-grid { grid-template-columns: 3fr 2fr; }
}

.input-panel, .result-panel, .save-section { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.result-panel { margin-top: 0; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; }
input[type="number"], input[type="text"] { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; }
input:focus { outline: none; border-color: #0b7a75; box-shadow: 0 0 0 3px rgba(11,122,117,0.2); }

.time-inputs .time-group { display: flex; align-items: center; gap: 8px; }
.time-inputs input[type="number"] { width: 80px; }
.time-inputs .sep { font-size: 1rem; color: #666; }

fieldset.presets { border: none; margin: 24px 0 0; }
legend { font-weight: 600; margin-bottom: 10px; }
.preset-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-buttons button { padding: 8px 12px; background: #eef2f5; border: 1px solid #ccc; border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.preset-buttons button:hover { background: #dce4e8; }

.result-placeholder { color: #999; text-align: center; padding: 32px; }
.placeholder-text { font-style: italic; }

#result-content .result-big-number { font-size: 2.5rem; font-weight: 700; color: #0b7a75; margin: 16px 0; }
.result-breakdown { font-size: 1rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.result-actions button { padding: 10px 16px; background: #0b7a75; color: #fff; border: none; border-radius: 8px; cursor: pointer; }
.result-actions button:hover { background: #095f5a; }

.save-section { margin-top: 32px; }
.custom-preset, .history { margin-bottom: 32px; }
.custom-preset h3, .history h3 { margin-bottom: 12px; }
#preset-name { width: 100%; margin-bottom: 8px; }
#save-preset { padding: 8px 16px; background: #0b7a75; color: #fff; border: none; border-radius: 8px; cursor: pointer; }
.preset-list, .history-list { list-style: none; margin-top: 12px; }
.preset-list li, .history-list li { padding: 8px 12px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.history-list li span { font-size: 0.9rem; color: #555; }
button.load-preset, button.load-history { padding: 4px 8px; background: #eef2f5; border: 1px solid #ccc; border-radius: 6px; cursor: pointer; }
button.delete-btn { padding: 4px 8px; background: #fee; border: 1px solid #fcc; border-radius: 6px; cursor: pointer; color: #c00; }
#clear-history { padding: 6px 12px; background: #eee; border: 1px solid #ccc; border-radius: 8px; cursor: pointer; }

.ad-slot-container { max-width: 1100px; margin: 0 auto 40px; padding: 0 20px; }
#ad-slot { min-height: 120px; background: #fafafa; border: 1px dashed #ccc; display: flex; align-items: center; justify-content: center; }

.support { background: #fff; padding: 48px 0 40px; }
.support h2 { margin-bottom: 24px; color: #0b7a75; }
.support h3 { margin: 32px 0 16px; }
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 32px; }
.example-card { background: #f4f7f6; padding: 16px; border-radius: 8px; }
.example-card h4 { margin-bottom: 8px; }
.support ul, .support dl { margin-left: 20px; }
.qa-list dt { font-weight: 600; margin-top: 16px; }
.qa-list dd { margin-left: 0; margin-bottom: 16px; color: #444; }

footer { background: #222; color: #ccc; padding: 32px 0; text-align: center; font-size: 0.9rem; }
footer a { color: #0b7a75; text-decoration: none; }
.footer-nav { display: flex; justify-content: center; gap: 20px; margin-top: 10px; }
.footer-nav a { color: #ccc; }

@media print {
  body { background: #fff; }
  header, .skip-to-main, .ad-slot-container, .save-section, .support, footer, .intro { display: none !important; }
  .calculator { padding: 0; }
  .calculator-grid { grid-template-columns: 1fr; }
  .input-panel { display: none; }
  .result-panel { box-shadow: none; border: 1px solid #ccc; }
  .result-actions { display: none; }
}


/* 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;
}
