:root {
  color: #172026;
  background: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.12), transparent 260px),
    #f8fafc;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: calc(18px + env(safe-area-inset-top)) 18px 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.08;
}

h2 {
  font-size: 22px;
}

.eyebrow {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 6px;
}

.status-pill,
.install-hint,
.chip {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 12px;
}

main {
  display: grid;
  gap: 14px;
  padding: 0 14px calc(28px + env(safe-area-inset-bottom));
}

.today-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.today-panel p:last-child {
  margin-top: 8px;
  color: #475569;
}

.install-hint {
  padding: 10px;
  text-align: left;
}

.controls {
  display: grid;
  gap: 10px;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -14px;
  padding: 10px 14px;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.72);
}

.day-scroll,
.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.day-scroll::-webkit-scrollbar,
.category-scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  min-width: max-content;
  padding: 10px 12px;
}

.chip small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}

.chip.active {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.chip.active small {
  color: rgba(255, 255, 255, 0.76);
}

.search-box {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
}

input {
  min-height: 44px;
  min-width: 0;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  color: #172026;
}

.phrase-grid {
  display: grid;
  gap: 12px;
}

.phrase-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.phrase-head,
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.phrase-head span {
  color: #0f766e;
  font-size: 13px;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
  font-size: 22px;
}

.icon-button.saved {
  color: #b45309;
  background: #fffbeb;
  border-color: #f59e0b;
}

.english {
  color: #334155;
  line-height: 1.45;
}

.indonesian {
  padding: 10px;
  border-radius: 8px;
  background: #ecfeff;
  color: #155e75;
  line-height: 1.45;
}

.actions button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
}

.speak {
  background: #0f766e;
}

.show {
  background: #1e293b;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.72);
}

.display-card {
  position: relative;
  display: grid;
  gap: 20px;
  width: min(720px, 100%);
  min-height: 64vh;
  align-content: center;
  padding: 54px 22px 30px;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.display-card p {
  color: #64748b;
  font-size: 18px;
}

.display-card strong {
  color: #0f172a;
  font-size: clamp(34px, 9vw, 68px);
  line-height: 1.12;
  letter-spacing: 0;
}

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 32px;
  line-height: 1;
}

@media (min-width: 760px) {
  .topbar,
  main {
    width: min(1080px, 100%);
    margin: 0 auto;
  }

  .phrase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 19px;
  }

  .topbar,
  .today-panel,
  .phrase-head,
  .actions {
    align-items: stretch;
  }

  .topbar,
  .today-panel {
    flex-direction: column;
  }

  .status-pill,
  .install-hint {
    width: 100%;
  }

  .today-panel {
    padding: 14px;
  }

  .phrase-card {
    padding: 13px;
  }

  .display-card {
    min-height: 78vh;
    padding-left: 16px;
    padding-right: 16px;
  }
}
