:root {
  --bg1: #3b2f5e;
  --bg2: #6b4f8a;
  --gold: #f5d97a;
  --cream: #fdf6e3;
  --ink: #2d2340;
  --soft: #efe7d0;
  --danger: #c0392b;
  --ok: #2e8b57;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  color: var(--ink);
  min-height: 100vh;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 520px;
  background: transparent;
}

header {
  text-align: center;
  color: var(--cream);
  padding: 20px 10px 24px;
}

header h1 {
  font-family: Georgia, serif;
  font-size: 1.9rem;
  letter-spacing: .5px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

header .cross {
  color: var(--gold);
  font-size: 2.2rem;
  display: block;
  margin-bottom: 4px;
}

header p {
  opacity: .85;
  font-size: .95rem;
  margin-top: 6px;
}

.card {
  background: var(--cream);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-bottom: 16px;
}

.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  transition: transform .1s, box-shadow .2s;
  background: var(--soft);
  color: var(--ink);
}

.btn:active {
  transform: scale(.98);
}

.btn.primary {
  background: var(--bg1);
  color: var(--cream);
}

.btn.gold {
  background: var(--gold);
  color: var(--ink);
}

.btn.ghost {
  background: transparent;
  border: 2px solid var(--bg1);
  color: var(--bg1);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.small {
  padding: 10px 14px;
  font-size: .9rem;
  display: inline-block;
  width: auto;
  margin-right: 6px;
}

.type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.type-btn {
  padding: 22px 16px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--cream);
  position: relative;
  overflow: hidden;
  transition: transform .15s;
}

.type-btn:active {
  transform: scale(.97);
}

.type-btn.daily {
  background: linear-gradient(135deg, #6b4f8a, #3b2f5e);
}

.type-btn.weekly {
  background: linear-gradient(135deg, #8a6b4f, #5e3b2f);
}

.type-btn.monthly {
  background: linear-gradient(135deg, #4f6b8a, #2f3b5e);
}

.type-btn h3 {
  font-family: Georgia, serif;
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.type-btn span {
  opacity: .85;
  font-size: .85rem;
}

.type-btn .ico {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  opacity: .4;
}

label {
  display: block;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--bg1);
  font-size: .95rem;
}

textarea, input[type=text], input[type=date], input[type=file], select {
  width: 100%;
  padding: 12px;
  border: 2px solid #d8cfb4;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  resize: vertical;
  min-height: 70px;
}

select {
  min-height: 48px;
  cursor: pointer;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--bg1);
}

.back {
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1rem;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-item {
  background: var(--cream);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  border-left: 5px solid var(--gold);
  transition: transform .1s;
}

.history-item:active {
  transform: scale(.99);
}

.history-item .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item .tipo {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg1);
  color: var(--cream);
}

.history-item .tipo.semanal {
  background: #8a6b4f;
}

.history-item .tipo.mensual {
  background: #4f6b8a;
}

.history-item .fecha {
  font-size: .85rem;
  color: #666;
  margin-top: 4px;
}

.history-item .preview {
  font-size: .9rem;
  color: #444;
  margin-top: 6px;
  font-style: italic;
}

.empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--cream);
  opacity: .85;
}

.empty .big {
  font-size: 3rem;
  margin-bottom: 10px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: var(--cream);
  border-radius: 18px;
  padding: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-family: Georgia, serif;
  color: var(--bg1);
  margin-bottom: 12px;
}

.answer-block {
  margin-bottom: 14px;
}

.answer-block .q {
  font-weight: 600;
  color: var(--bg1);
  font-size: .9rem;
  margin-bottom: 4px;
}

.answer-block .a {
  background: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--gold);
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: .95rem;
}

.answer-block .a.empty {
  color: #999;
  font-style: italic;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  padding: 12px 20px;
  border-radius: 30px;
  font-size: .9rem;
  z-index: 200;
  opacity: 0;
  transition: opacity .3s;
}

.toast.show {
  opacity: 1;
}

.stats {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  flex: 1;
  background: rgba(255,255,255,.1);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  color: var(--cream);
}

.stat .num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  font-family: Georgia, serif;
}

.stat .lbl {
  font-size: .75rem;
  opacity: .85;
  margin-top: 2px;
}

.confirm {
  text-align: center;
}

.confirm p {
  margin: 10px 0 18px;
  font-size: 1rem;
}

.confirm .row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.verse-suggester {
  background: linear-gradient(135deg, #fdf6e3, #f5e6c8);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.verse-suggester .verse-text {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--bg1);
  font-size: 1.05rem;
  margin-bottom: 10px;
  line-height: 1.4;
}

.verse-suggester .verse-ref {
  font-weight: 700;
  color: var(--bg2);
  font-size: .9rem;
  margin-bottom: 12px;
}

.verse-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.progress-bar {
  background: #d8cfb4;
  height: 8px;
  border-radius: 4px;
  margin: 10px 0;
  overflow: hidden;
}

.progress-fill {
  background: var(--ok);
  height: 100%;
  transition: width 0.3s ease;
}

.verse-list {
  margin-top: 16px;
  text-align: left;
}

.verse-list-item {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #e0d6c0;
}

.verse-list-item.completed {
  background: #e8e8e8;
  color: #888;
  text-decoration: line-through;
}

.verse-list-item.active {
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(245,217,122,0.3);
}

.verse-list-item .icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.verse-list-item .text {
  font-style: italic;
  line-height: 1.3;
}

.reset-btn {
  margin-top: 12px;
  font-size: .85rem;
  color: var(--bg2);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
}