* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f3ec;
  color: #171717;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.app {
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 10px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #756f64;
  font-size: 13px;
  font-weight: 700;
}

h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(34px, 9vw, 56px);
  line-height: 1.06;
  letter-spacing: 0;
}

.capture {
  margin-top: 24px;
}

.image-picker {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #d2c8b9;
  border-radius: 8px;
  background: #e4ddd1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f5a52;
  font-size: 16px;
}

.image-picker input {
  display: none;
}

.preview-grid {
  width: 100%;
  height: 100%;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
}

.preview-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #d8d0c4;
}

.preview-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-tile span {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.78);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

button {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
}

.primary {
  margin-top: 14px;
  background: #111111;
  color: #ffffff;
}

.primary:disabled {
  background: #cfc6ba;
}

.secondary {
  background: #ebe4d8;
  color: #111111;
}

.result {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #dfd7ca;
  border-radius: 8px;
  background: #ffffff;
}

.object-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.muted {
  margin: 0;
  color: #68645c;
  font-size: 13px;
}

h2 {
  margin: 5px 0 0;
  font-size: 30px;
}

.tag,
.keyword {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  font-size: 13px;
  height: 28px;
  padding: 0 10px;
}

.tag {
  background: #e6efe8;
  color: #245037;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.keyword {
  color: #654313;
  background: #f4e6ca;
}

.facts {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: #5f5a52;
  line-height: 1.5;
}

h3 {
  margin: 24px 0 12px;
}

.style-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.style-tab {
  height: 42px;
  border: 1px solid #dfd7ca;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 700;
}

.style-tab.active {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.copy-box {
  min-height: 112px;
  margin: 12px 0;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #dfd7ca;
  background: #f9f6f0;
  line-height: 1.6;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  font-size: 14px;
}

.history-section {
  margin-top: 26px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-head h3 {
  margin: 0 0 12px;
}

.text-button {
  width: auto;
  height: 34px;
  padding: 0 12px;
  background: transparent;
  color: #68645c;
  font-size: 14px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  height: auto;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid #dfd7ca;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.history-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: #e4ddd1;
}

.history-thumb {
  position: relative;
  width: 72px;
  height: 72px;
}

.history-thumb em {
  position: absolute;
  right: 5px;
  bottom: 5px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.78);
  color: #ffffff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.history-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.history-item strong {
  font-size: 16px;
}

.history-item small {
  color: #68645c;
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-history {
  margin: 0;
  padding: 18px;
  border: 1px dashed #d2c8b9;
  border-radius: 8px;
  color: #68645c;
  text-align: center;
}
