/* === Plano Bolt Porto === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0e1116;
  color: #f0f6fc;
  line-height: 1.5;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
a { color: #58a6ff; text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* === Layout === */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 12px 80px;
}
@media (min-width: 720px) {
  .app { max-width: 720px; }
}

/* === Header === */
.header {
  position: sticky; top: 0; z-index: 50;
  background: #0e1116;
  border-bottom: 1px solid #21262d;
  padding: 12px 0;
  margin: 0 -12px 16px;
  padding-left: 12px; padding-right: 12px;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.now-time { font-size: 15px; color: #c9d1d9; }
.now-time strong { color: #f0f6fc; font-size: 22px; font-weight: 800; }
.now-card {
  margin-top: 10px;
  background: linear-gradient(135deg, #0d2818, #052e16);
  border: 1px solid #2ea043;
  border-radius: 10px;
  padding: 12px;
}
.now-card.tier-must   { background: linear-gradient(135deg, #2d2410, #3d2e0a); border-color: #ffd700; box-shadow: 0 0 30px rgba(255,215,0,0.2); }
.now-card.tier-strong { background: linear-gradient(135deg, #0d2818, #052e16); border-color: #2ea043; }
.now-card.tier-good   { background: linear-gradient(135deg, #2d2410, #3d2e0a); border-color: #d29922; }
.now-card.tier-filler { background: linear-gradient(135deg, #1c2128, #161b22); border-color: #6e7681; }
.now-card.tier-avoid  { background: linear-gradient(135deg, #2d1217, #3d0d12); border-color: #f85149; }
.now-card.tier-off    { background: #161b22; border-color: #30363d; }
.now-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: #c9d1d9; margin-bottom: 4px; font-weight: 700; }
.now-title { font-weight: 800; font-size: 22px; line-height: 1.25; }
.now-time-range { color: #c9d1d9; font-size: 14px; margin-top: 4px; font-weight: 600; }
.now-reason { font-size: 15px; margin-top: 10px; color: #f0f6fc; line-height: 1.5; }
.now-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.now-actions a, .now-actions button {
  flex: 1 1 auto;
  text-align: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-maps { background: #1f6feb; color: white; }
.btn-waze  { background: #33ccff; color: #0e1116; }
.btn-calc  { background: #d29922; color: #0e1116; }
.btn-maps:hover { background: #388bfd; text-decoration: none; }
.btn-waze:hover { background: #62d6ff; text-decoration: none; }
.btn-calc:hover { background: #f0ae3a; }

/* === Tabs === */
.tabs {
  display: flex; gap: 4px;
  margin: 12px -12px 0;
  padding: 0 12px;
  border-bottom: 1px solid #21262d;
  overflow-x: auto;
}
.tab {
  background: transparent;
  border: 0;
  color: #8b949e;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
}
.tab:hover { color: #c9d1d9; }
.tab.active { color: #f0f6fc; border-bottom-color: #2ea043; }

/* === V2 Operational specific === */
.v2-decision-box {
  padding: 14px; border-radius: 10px;
  margin-top: 8px;
  border: 2px solid;
  text-align: center;
}
.v2-decision-box.move    { background: rgba(46,160,67,0.12);  border-color: #2ea043; }
.v2-decision-box.stay    { background: rgba(88,166,255,0.12); border-color: #58a6ff; }
.v2-decision-box.wait    { background: rgba(210,153,34,0.12); border-color: #d29922; }
.v2-decision-box.alt     { background: rgba(248,81,73,0.12);  border-color: #f85149; }
.v2-decision-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.v2-decision-detail { font-size: 14px; color: #c9d1d9; }

.v2-destino-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px;
  background: #0d1117; border-radius: 8px;
  margin-bottom: 6px;
  border-left: 4px solid;
}
.v2-destino-row.good { border-left-color: #2ea043; }
.v2-destino-row.med  { border-left-color: #d29922; }
.v2-destino-row.bad  { border-left-color: #f85149; }
.v2-destino-icon { font-size: 18px; flex-shrink: 0; }
.v2-destino-name { font-weight: 700; color: #f0f6fc; }
.v2-destino-area { font-size: 12px; color: #c9d1d9; margin-top: 2px; }

.v2-playbook-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}
.v2-playbook-card h3 { margin: 0 0 10px; font-size: 16px; color: #f0f6fc; }
.v2-pb-section { margin-bottom: 8px; font-size: 13px; }
.v2-pb-section strong { color: #f0f6fc; display: block; margin-bottom: 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.v2-pb-section ul { margin: 2px 0 4px; padding-left: 20px; color: #c9d1d9; }
.v2-pb-section.when ul li::marker     { color: #2ea043; }
.v2-pb-section.avoid ul li::marker    { color: #f85149; }
.v2-pb-section.leave ul li::marker    { color: #d29922; }
.v2-pb-next { background: rgba(88,166,255,0.08); padding: 6px 8px; border-radius: 6px; font-size: 12px; color: #c9d1d9; margin-top: 6px; }
.v2-pb-tip  { background: rgba(210,153,34,0.08); padding: 6px 8px; border-radius: 6px; font-size: 12px; color: #c9d1d9; margin-top: 6px; }

.v2-kill-card {
  background: rgba(248,81,73,0.05);
  border: 1px solid rgba(248,81,73,0.4);
  border-left: 5px solid #f85149;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.v2-kill-name {
  font-weight: 700; color: #f85149;
  font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.v2-kill-pattern { font-size: 13px; color: #f0f6fc; margin-bottom: 4px; }
.v2-kill-cost    { font-size: 12px; color: #c9d1d9; margin-bottom: 6px; }
.v2-kill-action  { font-weight: 700; color: #f0f6fc; font-size: 13px; }

.v2-time-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: #0d1117; border-radius: 8px;
  padding: 10px;
  margin-bottom: 6px;
  border-left: 3px solid #d29922;
}
.v2-time-trigger { font-size: 13px; color: #c9d1d9; }
.v2-time-action  { font-size: 13px; color: #f0f6fc; font-weight: 600; }

.v2-rule-table {
  background: #0d1117; border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.v2-rule-table h3 {
  margin: 0; padding: 10px 12px;
  font-size: 14px; color: #f0f6fc;
  background: #161b22;
  border-bottom: 1px solid #21262d;
}
.v2-rule-row {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 8px 12px;
  border-bottom: 1px solid #21262d;
  gap: 12px;
  font-size: 13px;
}
.v2-rule-row:last-child { border-bottom: 0; }
.v2-rule-row .left  { color: #c9d1d9; }
.v2-rule-row .right { color: #f0f6fc; font-weight: 600; }

/* === Sections === */
.section { margin: 24px 0; }
.section h2 {
  font-size: 20px; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: #f0f6fc;
  font-weight: 800;
}
.section h2 .badge { font-size: 12px; background: #21262d; padding: 3px 10px; border-radius: 999px; color: #c9d1d9; font-weight: 600; }

/* === Day cards === */
.day {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.day.today { border-color: #2ea043; box-shadow: 0 0 0 1px #2ea043 inset; }
.day-header {
  padding: 12px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  color: inherit;
}
.day-header:hover { background: #1c2128; }
.day-title { font-weight: 700; font-size: 17px; color: #f0f6fc; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-headline { font-size: 13px; color: #c9d1d9; margin-top: 3px; line-height: 1.4; }
.day.past:not(.expanded) { opacity: 0.45; }
.day.past .day-title { font-weight: 600; }
.day-rank-badge {
  background: #21262d; color: #c9d1d9;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}
.day-stats {
  display: flex; gap: 6px; margin-top: 8px;
  flex-wrap: wrap; align-items: center;
}
.stat-tag {
  background: #0d1117; color: #c9d1d9;
  border: 1px solid #21262d;
  font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
}
.stat-tag.stat-total { color: #ffd700; border-color: rgba(255,215,0,0.3); }
.day-grade {
  font-size: 14px; font-weight: 800;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.grade-S { background: #ffd700; color: #1a1300; box-shadow: 0 0 12px rgba(255,215,0,0.4); }
.grade-A { background: #2ea043; color: white; }
.grade-B { background: #d29922; color: #1a1100; }
.grade-C { background: #6e7681; color: white; }
.grade-D { background: #30363d; color: #8b949e; }
.day-toggle { font-size: 18px; color: #8b949e; }
.day.expanded .day-toggle { transform: rotate(180deg); }
.day-body { padding: 0 12px 12px; display: none; }
.day.expanded .day-body { display: block; }
.day-drivers { background: #0d1117; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; line-height: 1.5; }
.day-drivers strong { color: #f0f6fc; }
.day-drivers ul { margin: 6px 0 0; padding-left: 20px; }
.day-drivers li { margin: 3px 0; color: #f0f6fc; }

/* === Block items === */
.block {
  background: #0d1117;
  border: 1px solid #21262d;
  border-left: 4px solid #30363d;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.block.tier-must   { border-left-color: #ffd700; border-left-width: 5px; background: linear-gradient(90deg, rgba(255,215,0,0.06), #0d1117 35%); }
.block.tier-strong { border-left-color: #2ea043; }
.block.tier-good   { border-left-color: #d29922; }
.block.tier-filler { border-left-color: #6e7681; opacity: 0.85; }
.block.tier-avoid  { border-left-color: #f85149; opacity: 0.7; }
.block.tier-must .block-zone { color: #ffd700; }
.block.now {
  box-shadow: 0 0 0 2px #2ea043, 0 0 20px rgba(46,160,67,0.3);
  background: #0d2818;
}
.block.now.tier-must { box-shadow: 0 0 0 2px #ffd700, 0 0 24px rgba(255,215,0,0.4); background: #2d2410; }
.block.past { opacity: 0.4; }
.block.past .block-zone { text-decoration: line-through; }
.tier-pill {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em;
}
.tier-pill.must   { background: #ffd700; color: #1a1300; }
.tier-pill.strong { background: #2ea043; color: white; }
.tier-pill.good   { background: #d29922; color: #1a1100; }
.tier-pill.filler { background: #30363d; color: #c9d1d9; }
.tier-pill.avoid  { background: #f85149; color: white; }
.eurh-tag {
  font-size: 12px; color: #c9d1d9; font-weight: 700;
  background: #0d1117; padding: 2px 8px; border-radius: 4px;
  border: 1px solid #21262d;
}
.eurh-tag.high { color: #ffd700; border-color: #ffd700; }
.tip-tag {
  font-size: 12px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid;
}
.tip-tag.tip-high { color: #ffd700; border-color: rgba(255,215,0,0.5); background: rgba(255,215,0,0.08); }
.tip-tag.tip-med  { color: #d29922; border-color: rgba(210,153,34,0.5); background: rgba(210,153,34,0.05); }
.tip-text-high { color: #ffd700; font-weight: 700; }
.tip-text-med  { color: #d29922; font-weight: 600; }
.demand-tag {
  font-size: 11px; color: #8b949e; margin-top: 4px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.demand-tag span { background: #0d1117; padding: 2px 6px; border-radius: 4px; }
.block-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  font-size: 14px; color: #c9d1d9; font-weight: 700;
  margin-bottom: 6px;
}
.block-head > span:first-child { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.block-head .pill {
  background: #21262d; border-radius: 999px;
  padding: 2px 8px; font-size: 11px; font-weight: 600;
}
.block-head .icon-actions { display: flex; gap: 6px; }
.block-head .icon-actions a {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  text-decoration: none;
  flex: 0 0 auto;
}
.block-head .icon-actions a:active { transform: scale(0.94); }
.block-zone { font-weight: 800; font-size: 17px; margin: 2px 0 4px; color: #f0f6fc; line-height: 1.3; }
.block-reason { font-size: 14px; color: #f0f6fc; line-height: 1.5; }
.block.now .block-zone { color: #7ee787; }

/* === Generic cards === */
.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.card h3 { margin: 0 0 8px; font-size: 15px; color: #f0f6fc; }
.card p { margin: 4px 0; font-size: 14px; }

/* === Live sources grid === */
.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.source-link {
  display: flex; flex-direction: column; gap: 2px;
  background: #0d1117; border: 1px solid #21262d; border-radius: 8px;
  padding: 10px; min-height: 64px;
  text-decoration: none; color: #e6edf3;
}
.source-link:hover { border-color: #58a6ff; text-decoration: none; }
.source-emoji { font-size: 20px; }
.source-label { font-weight: 700; font-size: 14px; color: #f0f6fc; }
.source-desc { font-size: 12px; color: #c9d1d9; line-height: 1.4; }

/* === Rules table === */
.rules-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rules-table th, .rules-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #21262d; }
.rules-table th { background: #161b22; color: #8b949e; font-weight: 600; font-size: 12px; }
.rules-table tr:last-child td { border-bottom: 0; }
.rule-good { color: #3fb950; font-weight: 600; }
.rule-bad  { color: #f85149; font-weight: 600; }

/* === Calc modal === */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100; align-items: flex-start; justify-content: center;
  padding: 20px 12px;
  overflow-y: auto;
}
.modal-bg.open { display: flex; }
.modal {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 16px;
  width: 100%; max-width: 440px;
  margin: auto;
}
.modal h2 { margin: 0 0 12px; }
.modal-close {
  background: #21262d; color: #e6edf3;
  border: 0; border-radius: 8px;
  padding: 6px 10px; font-size: 13px;
  float: right;
}
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 13px; color: #8b949e; margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 10px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e6edf3;
  font-size: 16px;
  min-height: 44px;
}
.field input:focus, .field select:focus { outline: 0; border-color: #58a6ff; }
.calc-result {
  margin-top: 12px;
  padding: 14px; border-radius: 10px;
  text-align: center;
}
.calc-result.accept { background: rgba(46,160,67,0.15); border: 2px solid #2ea043; }
.calc-result.borderline { background: rgba(210,153,34,0.15); border: 2px solid #d29922; }
.calc-result.reject { background: rgba(248,81,73,0.15); border: 2px solid #f85149; }
.calc-decision { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.calc-reason { font-size: 13px; color: #c9d1d9; }
.calc-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 12px;
}
.metric { background: #0d1117; border-radius: 6px; padding: 8px; text-align: center; }
.metric-label { font-size: 11px; color: #8b949e; }
.metric-value { font-size: 16px; font-weight: 700; margin-top: 2px; }

/* === Calc form grid (reused) === */
.tracker-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tracker-form .field { margin: 0; }

/* === Ships table === */
.ships-table { width: 100%; border-collapse: collapse; font-size: 14px; color: #f0f6fc; }
.ships-table th, .ships-table td { padding: 8px 8px; text-align: left; border-bottom: 1px solid #21262d; }
.ships-table th { color: #c9d1d9; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.ships-table tr.highlight td { background: rgba(46,160,67,0.08); }
.ships-table .ship-name { font-weight: 600; }
.ships-table .ship-pax  { color: #d29922; font-weight: 600; }

/* === Events list === */
.events-list { display: flex; flex-direction: column; gap: 4px; }
.event-row {
  display: grid; grid-template-columns: 60px 1fr; gap: 8px;
  padding: 8px;
  background: #0d1117; border-radius: 6px;
  font-size: 13px;
}
.event-time { color: #f0f6fc; font-weight: 700; font-size: 13px; }
.event-name { font-weight: 700; color: #f0f6fc; }
.event-venue { color: #c9d1d9; font-size: 13px; margin-top: 2px; }

/* === Misc === */
.muted { color: #c9d1d9; }
.note {
  background: rgba(88,166,255,0.08);
  border-left: 3px solid #58a6ff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 8px 0;
}
.warn {
  background: rgba(248,81,73,0.08);
  border-left: 3px solid #f85149;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 8px 0;
}
.success {
  background: rgba(46,160,67,0.08);
  border-left: 3px solid #2ea043;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 8px 0;
}

/* === Footer === */
.foot {
  margin-top: 30px; padding-top: 16px;
  border-top: 1px solid #21262d;
  font-size: 12px; color: #8b949e;
  text-align: center;
}

/* === Print: clean, no buttons === */
@media print {
  .header, .now-actions, .block-actions, .tracker-form, .modal-bg, .btn-calc { display: none !important; }
  body { background: white; color: black; }
  .day { page-break-inside: avoid; border: 1px solid #ccc; }
  .day-body { display: block !important; }
}
