/* Time Card Calculator — styles */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1c2330;
  --muted: #5b6577;
  --line: #dfe3ea;
  --accent: #1668dc;
  --accent-dark: #0f4fa8;
  --danger: #c0362c;
  --pro: #b7791f;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* header / footer */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 12px; padding-bottom: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem;
}
.header-note { color: var(--muted); font-size: 0.85rem; }
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; background: var(--card); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 16px; padding-bottom: 16px; color: var(--muted); font-size: 0.9rem;
}
.footer-inner nav a { color: var(--muted); margin-left: 16px; }

/* headings / content */
h1 { font-size: 1.9rem; margin: 26px 0 8px; }
.lede { color: var(--muted); font-size: 1.05rem; margin: 0 0 18px; }
.content { margin-top: 36px; }
.content h2 { font-size: 1.3rem; margin: 28px 0 8px; }
.content h3 { font-size: 1.05rem; margin: 18px 0 4px; }
.content p, .content li { color: #2c3547; }
.faq h3 { color: var(--ink); }
.disclaimer {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fffbe9; padding: 4px 18px 10px; margin-top: 28px;
}

/* ad placeholder */
.ad-slot {
  border: 1.5px dashed #c3cad6; border-radius: var(--radius);
  color: #98a2b3; text-align: center; font-size: 0.8rem; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 22px 0; margin: 0 0 18px;
  background: #eef0f4;
}

/* calculator card */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-top: 6px;
  box-shadow: 0 1px 3px rgba(20, 30, 50, 0.05);
}

.settings {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.field input[type="number"], .field select {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; min-width: 130px; background: #fff;
}
.field.checkbox { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 6px; }
.field.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.field.checkbox small { color: var(--muted); }
.export-field { margin-left: auto; }
.export-buttons { display: flex; gap: 8px; }

.pro-badge {
  background: var(--pro); color: #fff; font-size: 0.62rem; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; vertical-align: 2px; letter-spacing: 0.05em;
}

/* buttons */
.btn {
  font: inherit; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 14px;
}
.btn:hover { border-color: #b9c2d0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { font-weight: 600; }
.btn-small { padding: 4px 10px; font-size: 0.85rem; }
.btn-danger { color: var(--danger); }
.btn-wide { width: 100%; padding: 12px; font-size: 1.02rem; }

/* week cards */
.week-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 16px; }
.week-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.week-title {
  font: inherit; font-weight: 700; font-size: 1.05rem; border: none;
  border-bottom: 1px dashed transparent; padding: 2px 4px;
  flex: 1 1 140px; min-width: 0; max-width: 60%;
}
.week-title:focus { outline: none; border-bottom-color: var(--accent); }
.week-head-btns { display: flex; gap: 6px; }

.time-table { width: 100%; border-collapse: collapse; }
.time-table th {
  text-align: left; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.time-table td { padding: 5px 8px; border-bottom: 1px solid #eef1f5; }
.time-table input {
  font: inherit; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 7px; width: 100%; max-width: 150px;
}
.day-name { font-weight: 600; white-space: nowrap; }
.day-hours { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }

.week-summary {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px;
}
.sum-item {
  flex: 1; min-width: 140px; background: var(--bg); border-radius: 9px;
  padding: 8px 12px; display: flex; flex-direction: column;
}
.sum-item span { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sum-item strong { font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.sum-item em { font-style: normal; color: var(--accent-dark); font-weight: 600; }
.sum-item.total { background: #e8f0fd; }

.week-actions { margin-top: 16px; }

.grand-total { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.grand-total h2 { font-size: 1.05rem; margin: 0 0 10px; }
.grand-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grand-grid > div { background: var(--bg); border-radius: 9px; padding: 8px 12px; display: flex; flex-direction: column; }
.grand-grid span { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.grand-grid strong { font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.grand-grid .grand-pay { background: #e8f0fd; }
.grand-grid .grand-pay strong { color: var(--accent-dark); }

.saved-note { color: var(--muted); font-size: 0.82rem; margin: 10px 0 0; }

/* paywall modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 22, 38, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 14px; max-width: 420px; width: 100%;
  padding: 24px; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.modal h2 { margin: 0 0 8px; font-size: 1.25rem; }
.modal .price { font-size: 1.7rem; font-weight: 800; margin: 12px 0; }
.modal .price small { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.modal-note { color: var(--muted); font-size: 0.85rem; text-align: center; }
.modal-close {
  position: absolute; top: 8px; right: 12px; border: none; background: none;
  font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1;
}

/* print sheet — screen-hidden, print-only */
#print-sheet { display: none; }

@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  #print-sheet { display: block; visibility: visible; position: absolute; inset: 0; padding: 24px; }
  #print-sheet * { visibility: visible; }
  #print-sheet table { border-collapse: collapse; width: 100%; margin-bottom: 12px; }
  #print-sheet th, #print-sheet td { border: 1px solid #999; padding: 4px 8px; text-align: left; }
  #print-sheet .print-note { color: #555; font-size: 0.85rem; }
}

/* small screens: stack the time table */
@media (max-width: 640px) {
  h1 { font-size: 1.55rem; }
  .header-note { display: none; }
  .export-field { margin-left: 0; }
  .grand-grid { grid-template-columns: repeat(2, 1fr); }
  .time-table thead { display: none; }
  .time-table, .time-table tbody, .time-table tr, .time-table td { display: block; width: 100%; }
  .time-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .time-table td { border-bottom: none; padding: 4px 8px; display: flex; align-items: center; gap: 10px; }
  .time-table td::before {
    content: attr(data-label); flex: 0 0 92px;
    font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
  }
  .time-table td.day-name { font-size: 1rem; }
  .time-table td.day-name::before { content: ""; flex: 0; }
  .time-table td.day-hours { justify-content: flex-start; text-align: left; }
  .time-table input { max-width: none; }
}
