/* Reset some basics */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Helvetica Neue', Arial, sans-serif; background: #f2f2f2; padding: 40px 0 50px 0; }

/* Survey Styles */
.survey-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
}

/* Progress Steps */
.progress-container {
  padding: 20px;
  text-align: center;
}

.progress-steps {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e0e0e0;
  transition: background-color 0.3s ease;
}

.progress-dot.active {
  background: #00EEFF;
}

.progress-sublabel {
  font-size: 0.875rem;
  color: #666;
  margin-top: 8px;
}

/* Survey Header */
.survey-header {
  padding: 0 20px 20px;
  text-align: center;
}

.survey-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.question-subtitle {
  text-align: center;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 16px;
  font-weight: 500;
}

.single-question {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 16px;
}

.single-question .question-title {
  text-align: left;
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.single-question .question-subtitle {
  text-align: left;
  font-size: 0.875rem;
  color: #888;
  margin: 8px 0 16px 0;
  font-weight: 400;
}

.error-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.error-fallback h2 {
  color: #e74c3c;
  margin-bottom: 16px;
  font-size: 1.25rem;
}

.error-fallback button {
  background: #006FFF;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

/* Survey Content */
.survey-content {
  flex: 1;
  padding: 0 20px;
  overflow-y: auto;
}

/* Choice Cards */
.choice-card {
  display: block;
  width: 100%;
  padding: 16px;
  margin-bottom: 12px;
  border: 2px solid #00B2FF;
  border-radius: 12px;
  background: white;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.choice-card:hover {
  transform: scale(1.02);
}

.choice-card:active {
  transform: scale(1.00);
}

.choice-card.selected {
  background: #D9F4FF;
  border-color: #006FFF;
}

.choice-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Intro Cards */
.intro-cards {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.intro-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.intro-card h3 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 16px;
  text-align: center;
  color: #333;
}

/* Score Allocator */
.score-allocator {
  background: white;
  border-radius: 16px;
  padding: 20px;
}

.score-header {
  text-align: center;
  font-size: 1.125rem;
  font-weight: bold;
  margin-bottom: 24px;
  color: #333;
}

.score-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
}

.score-item-info {
  flex: 1;
}

.score-item-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.score-item-description {
  font-size: 0.875rem;
  color: #888;
  line-height: 1.4;
}

.score-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #00B2FF;
  background: white;
  color: #00B2FF;
  font-size: 1.125rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.stepper-btn:hover:not(:disabled) {
  background: #00B2FF;
  color: white;
}

.stepper-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.stepper-value {
  font-size: 1.125rem;
  font-weight: bold;
  min-width: 24px;
  text-align: center;
  color: #333;
}

/* Step Navigation */
.step-nav {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.step-nav-btn {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.step-nav-btn.prev {
  background: #B9EAFF;
  color: #333;
}

.step-nav-btn.next {
  background: #B9EAFF;
  color: #333;
}

.step-nav-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.step-nav-btn:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  margin: 20px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.modal-text {
  font-size: 1.125rem;
  color: #333;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-buttons {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-btn.secondary {
  background: #f0f0f0;
  color: #666;
}

.modal-btn.primary {
  background: #00B2FF;
  color: white;
}

.modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Results Page */
.results-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
  overflow-y: auto;
}

.results-header {
  padding: 24px 20px;
  text-align: center;
  background: #D9F4FF;
  color: #222;
  border-radius: 12px;
}

.results-title {
  font-size: 1.75rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.results-subtitle {
  font-size: 1rem;
  opacity: 0.9;
}

.results-grid {
  display: none;
}

/* Bar style results */
.bar-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.bar-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; overflow: hidden; }
.bar-summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; }
.bar-summary::-webkit-details-marker { display: none; }
.bar-title { font-weight: 600; color: #333; }
.bar-value { color: #006FFF; font-weight: 600; }
.bar-details { padding: 12px 16px; color: #555; background: #fafafa; border-top: 1px solid #eee; }

.result-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  border: 1px solid #f0f0f0;
}

.result-card-header {
  margin-bottom: 12px;
}

.result-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-card-content {
  text-align: center;
}

.result-card-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #00B2FF;
  margin-bottom: 8px;
}

.result-card-description {
  font-size: 0.875rem;
  color: #888;
  line-height: 1.4;
}

.results-actions {
  padding: 20px;
  display: flex;
  gap: 12px;
}

.results-btn {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.results-btn.secondary {
  background: #f0f0f0;
  color: #666;
}

.results-btn.primary {
  background: #00B2FF;
  color: white;
}

.results-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Placeholder Content */
.placeholder-content {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.placeholder-content p {
  margin-bottom: 12px;
  font-size: 1.125rem;
}

/* Baumann Questions */
.baumann-questions {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.baumann-question {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.question-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  text-align: center;
}

/* Photo Upload Section */
.photo-upload-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.upload-instructions {
  text-align: center;
}

.upload-instructions h3 {
  font-size: 1.25rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.upload-subtitle {
  color: #666;
  font-size: 0.875rem;
  line-height: 1.4;
}

.photo-requirements {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.required-photos h4,
.optional-photos h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.photo-placeholder {
  aspect-ratio: 1;
  border: 2px dashed #00B2FF;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-placeholder.optional {
  border-color: #ccc;
  opacity: 0.7;
}

.photo-placeholder:hover {
  background: #e3f2fd;
  transform: scale(1.02);
}

.photo-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.photo-placeholder span {
  font-size: 0.875rem;
  color: #666;
  text-align: center;
}

.consent-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
}

.consent-item {
  margin-bottom: 16px;
}

.consent-item:last-child {
  margin-bottom: 0;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.4;
}

.consent-checkbox {
  margin-top: 2px;
  width: 16px;
  height: 16px;
}

/* Product Registration */
.product-registration {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.product-upload-area {
  text-align: center;
}

.upload-placeholder {
  border: 2px dashed #00B2FF;
  border-radius: 16px;
  padding: 40px 20px;
  margin-bottom: 20px;
  background: #f8f9fa;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.upload-placeholder p {
  color: #666;
  margin-bottom: 4px;
}

.upload-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-btn {
  padding: 14px;
  border: 1px solid #00B2FF;
  border-radius: 8px;
  background: white;
  color: #00B2FF;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-btn:hover {
  background: #00B2FF;
  color: white;
}

.registered-products h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}

.no-products {
  text-align: center;
  color: #666;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.empty-subtitle {
  font-size: 0.875rem;
  color: #999;
  margin-top: 8px;
}

/* 제품 등록 인트로 */
.product-intro {
  text-align: center;
  padding: 40px 20px;
}

.intro-message h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}

.intro-description {
  font-size: 1.125rem;
  color: #006FFF;
  font-weight: 500;
  margin-bottom: 8px;
}

.intro-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 32px;
}

.intro-benefits {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 300px;
  margin: 0 auto;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #333;
}

.benefit-icon {
  font-size: 1.25rem;
}

/* 제품 등록 방법 */
.registration-header {
  text-align: center;
  margin-bottom: 32px;
}

.registration-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.registration-header p {
  font-size: 0.95rem;
  color: #666;
}

.upload-strong {
  margin-top: 8px;
  font-size: 0.95rem;
  color: #d32f2f;
  font-weight: 700;
}

.registration-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.method-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.2s ease;
}

.method-card:hover {
  border-color: #006FFF;
  box-shadow: 0 2px 8px rgba(0, 111, 255, 0.1);
}

.method-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.method-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.method-card p {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.4;
}

.method-btn {
  width: 100%;
  padding: 10px 16px;
  background: #006FFF;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.method-btn:hover {
  background: #0056cc;
}

.registered-products h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  text-align: center;
}

/* App container */
.app { position: relative; width: 100%; max-width: 480px; margin: 0 auto; height: calc(100vh - 90px); background: #fff; overflow: hidden; }

/* Skin type button */
.skin-type-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    writing-mode: vertical-rl;
    background: #e0e0e0;
    border: none;
    border-radius: 12px;
    padding: 12px 8px;
    font-weight: bold;
    cursor: pointer;
}

/* Card popup */
.skin-card {
    position: absolute;
    top: 60px; /* below button */
    right: 16px;
    width: 80%;
    max-width: 300px;
    height: 60%;
    background: #d9d9d9;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(110%);
    opacity: 0;
    z-index: 10;
}
.skin-card.visible {
    transform: translateX(0);
    opacity: 1;
}
.hidden { display: none; }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-header span { font-weight: bold; }
.close-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

.card-content { flex: 1; overflow-y: auto; }

/* Main display number */
.main-display { display: flex; justify-content: center; align-items: center; height: calc(100% - 120px); /* leave space for nav */ }
.page-index { font-size: 5rem; color: #000; }

/* Bottom navigation */
.bottom-nav {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 35px;
}

.nav-btn {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: none;
    background: #D9F4FF !important;
    font-size: 0.75rem;
    cursor: pointer;
    color: #333;
}

.nav-btn:hover { 
    background: #b8e8f5 !important; 
    opacity: 0.9;
}

.nav-btn:active { 
    background: #a0dcf0 !important; 
    transform: scale(0.95);
}

/* Edit overlay */
.edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}
.edit-overlay.hidden { display: none; opacity: 0; }
.edit-overlay.visible { display: flex; opacity: 1; }

.edit-panel {
    background: #ffffff;
    padding: 24px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 80%;
    max-width: 260px;
}
.edit-btn {
    padding: 12px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    background: #4caf50;
    color: #fff;
    cursor: pointer;
}
.edit-btn:disabled { background: #9e9e9e; cursor: not-allowed; }

/* Pages wrapper for horizontal sliding */
.pages-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}
.page {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Page indicators */
.page-indicators {
    position: absolute;
    bottom: 110px; /* above nav */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}
.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d0d0;
}
.indicator-dot.active { background: #606060; }

.analysis-buttons { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 50px; }
.big-btn { 
    width: 230px; 
    height: 85px; 
    font-size: 1.05rem; 
    background: #D9F4FF !important; 
    border: none; 
    border-radius: 16px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: #333;
    font-weight: 500;
}
.big-btn:hover {
    background: #b8e8f5 !important;
    opacity: 0.9;
}
.big-btn:active {
    background: #a0dcf0 !important;
    transform: scale(0.98);
}

.view { position: absolute; inset: 0; overflow: hidden; }
.view.hidden { display: none; }
.view.active { display: block; }

.analysis-mode .skin-type-btn,
.analysis-mode .bottom-nav,
.analysis-mode #pageView,
.analysis-mode #pageIndicators,
.analysis-mode #skinCard { display: none !important; }

/* analysis view is hidden by default; show and center only in analysis-mode */
.analysis-mode #analysisView { display: flex; flex-direction: column; justify-content: center; align-items: center; }

/* Internal nav inside analysis view */
.analysis-nav { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 20px; }
.analysis-nav-btn { width: 90px; height: 30px; background: #ffffff; border: none; cursor: pointer; font-size: 0.85rem; border-bottom: 2px solid transparent; }
.analysis-nav-btn.active { font-weight: 700; border-bottom-color: #000000; }

.record-view { position: absolute; inset: 0; background: #d9d9d9; display: flex; flex-direction: column; }
.record-view.hidden { display: none; }
.record-panel { padding: 16px; display: flex; gap: 12px; }
.record-legend { display: flex; flex-direction: column; gap: 8px; width: 90px; }
.record-legend label { font-size: 0.8rem; display: flex; align-items: center; gap: 6px; }
.record-chart { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; }
.record-dates { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 8px; font-size: 0.75rem; }
.record-info { flex: 1; background: #eaeaea; margin: 0 16px 60px; border-radius: 4px; }

.record-chart canvas { width: 260px; height: 200px; }

@media (max-width: 360px) {
  .record-chart canvas { width: 220px; height: 170px; }
}

@media (max-width: 320px) {
  .record-chart canvas { width: 200px; height: 150px; }
}

.routine-view { position: absolute; inset: 0; background: #d9d9d9; display: flex; flex-direction: column; }
.routine-view.hidden { display: none; }
.routine-header { position: relative; padding: 12px 12px 0; height: 179px; }
.routine-datebar { width: calc(100% - 24px); height: 40px; margin: 0 auto; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.routine-datebar .date-text { font-weight: 600; }
.routine-datebar .arrow { width: 0; height: 0; background: transparent; border: none; cursor: pointer; }
.routine-datebar .arrow.left { border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 8px solid #666; }
.routine-datebar .arrow.right { border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 8px solid #666; }

/* menu button placed 40px below date bar (date bar height 40 + gap 40) */
.routine-header-actions { position: absolute; right: 12px; top: 72px; }
.more-btn { background: #fff; border: 1px solid #ddd; width: 32px; height: 32px; border-radius: 16px; cursor: pointer; }
.mode-menu { top: 36px; right: 0; display: flex; flex-direction: column; gap: 8px; }
.mode-menu.hidden { display: none; }

/* spacing: header already includes 30px below menu; only row gap between cards */
.routine-cards { padding: 0 12px 0; display: grid; grid-template-columns: 1fr; row-gap: 30px; }
.routine-card { background: #fff; border-radius: 8px; padding: 10px; position: relative; height: 140px; display: flex; flex-direction: column; }
.routine-card h3 { margin-bottom: 6px; font-size: 0.95rem; }
.routine-list { overflow: auto; flex: 1; padding-right: 6px; display: flex; flex-direction: column; gap: 6px; }
.card-fab { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); border: 1px solid #ccc; width: 26px; height: 26px; border-radius: 13px; background: #fff; cursor: pointer; display: none; }
.card-fab.btn-add:hover { background: #e8f5e9; border-color: #4caf50; }
.card-fab.btn-remove:hover { background: #ffebee; border-color: #f44336; }

/* show card buttons based on routine mode */
.routine-view.mode-add .card-fab.btn-add { display: inline-block; }
.routine-view.mode-remove .card-fab.btn-remove { display: inline-block; }

.routine-footer { padding: 0 12px 60px; display: flex; justify-content: center; margin-top: 40px; }
.routine-footer .primary { width: 100px; height: 40px; background: #4caf50; color: #fff; border: none; border-radius: 8px; cursor: pointer; }

#eveningCard { height: 200px; }

.product-view { position:absolute; inset:0; background:#d9d9d9; display:flex; justify-content:center; align-items:center; }
.product-view.hidden{display:none;}
.product-empty{color:#777;font-size:0.9rem;}
.product-add { width: 60px; height: 60px; border: 2px dashed #000; border-radius: 8px; background:#fff; font-size:2rem; line-height:1; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.product-view { flex-direction:column; justify-content:flex-start; padding-top:40px; gap:20px; }

.product-list { width:100%; display:flex; flex-direction:column; gap:14px; padding:20px; }
.product-card { background:#fff; border-radius:8px; padding:10px 40px 10px 10px; position:relative; }
.product-card h4 { margin-bottom:4px; font-size:0.95rem; }
.product-card .remove { position:absolute; top:8px; right:8px; width:20px; height:20px; border:none; background:#fff; border:1px solid #000; border-radius:10px; line-height:18px; font-weight:700; cursor:pointer; }

/* input card */
.product-input { background:#fff; border-radius:8px; padding:12px; display:flex; gap:10px; position:relative; align-items:center; }
.img-btn { width:60px; height:60px; border:2px dashed #aaa; border-radius:8px; background:#fafafa; font-size:2rem; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.product-input .fields { flex:1; display:flex; flex-direction:column; gap:8px; }
.product-input input { border:1px solid #ccc; border-radius:6px; height:32px; padding:0 8px; }
.product-input .save { align-self:flex-end; width:70px; height:30px; background:#4caf50; border:none; color:#fff; border-radius:6px; cursor:pointer; }

.product-thumb{width:48px;height:48px;border-radius:6px;object-fit:cover;float:left;margin-right:8px;}
.product-thumb.placeholder{background:#fafafa;border:2px dashed #ccc;display:flex;align-items:center;justify-content:center;font-size:1.5rem;color:#999;}

.shop-view{position:absolute;inset:0;padding:40px 12px 50px;background:#d9d9d9;overflow-y:auto;}
.shop-view.hidden{display:none;}
.shop-card{background:#fff;border-radius:8px;padding:10px;display:flex;gap:10px;position:relative;margin-bottom:14px;}
.thumb{width:48px;height:48px;border-radius:6px;border:1px solid #ccc;}
.thumb.placeholder{background:#fafafa;}
.shop-info{flex:1;font-size:0.8rem;}
.shop-info h4{margin:2px 0;}
.shop-info .tags{font-size:0.75rem;color:#555;}
.rate{font-size:0.7rem;text-align:center;color:#333;}
.rate span{font-size:1.4rem;font-weight:700;color:#0a0;}
.details{margin-top:4px;font-size:0.7rem;list-style:disc;margin-left:16px;color:#444;}
.notice{text-align:center;font-size:0.7rem;color:#777;margin-top:8px;}

.menu-view{position:absolute;inset:0;background:#D9F4FF !important;padding:40px 12px 50px;display:flex;flex-direction:column;}
.menu-view.hidden{display:none;}
.menu-header{display:flex;justify-content:center;align-items:center;margin-bottom:20px;}
.menu-login-bar{width:200px;height:40px;background:#fff;border-radius:8px;display:flex;justify-content:flex-start;align-items:center;padding:0 15px;border:1px solid #ccc;}
.login-btn{background:transparent;border:none;font-size:0.85rem;cursor:pointer;color:#333;}
.user-email{font-size:0.85rem;color:#333;text-align:left;}
.user-email.clickable{cursor:pointer;text-decoration:underline;}
.menu-grid{flex:1;display:grid;grid-template-columns:repeat(3,1fr);grid-gap:40px;justify-items:center;align-content:flex-start;margin-top:60px;}
@media(max-width:360px){.menu-grid{grid-gap:35px;margin-top:50px;}}
@media(max-width:320px){.menu-grid{grid-gap:30px;margin-top:40px;}}
.menu-item{display:flex;flex-direction:column;align-items:center;gap:8px;}
.circle-btn{width:60px;height:60px;border-radius:30px;background:#fff;border:none;cursor:pointer;font-size:0.75rem;display:flex;align-items:center;justify-content:center;text-decoration:none;color:#333;box-shadow:0 2px 4px rgba(0,0,0,0.1);}
.circle-btn.disabled{background:#e0e0e0;cursor:default;color:#999;}
.circle-btn.coming-soon{background:#ccc;cursor:not-allowed;color:#666;font-size:0.6rem;text-align:center;line-height:1.1;}
.circle-btn:hover:not(.disabled):not(.coming-soon){background:#f5f5f5;}
.menu-label{font-size:0.75rem;color:#333;text-align:center;min-height:16px;}

.alarm-view{position:absolute;inset:0;background:#d9d9d9;padding:40px 12px 50px;display:flex;flex-direction:column;}
.alarm-view.hidden{display:none;}
.alarm-header{display:flex;justify-content:space-between;align-items:center;}
.alarm-title{font-weight:700;color:#666;}
.hamburger{background:transparent;border:none;font-size:1.4rem;cursor:pointer;}
.alarm-body{flex:1; overflow-y:auto;}
.alarm-view.edit-mode .alarm-card{ border:1px solid #f44336; }
.alarm-view.reorder-mode .alarm-card{ cursor:grab; }
.alarm-card{ transition: transform .12s ease, box-shadow .12s ease; }
/* SortableJS classes */
.alarm-chosen{ transform: scale(1.02); box-shadow:0 8px 16px rgba(0,0,0,.25); }
.alarm-drag{ transform: scale(1.02); box-shadow:0 8px 16px rgba(0,0,0,.25); }
.alarm-ghost{ background: rgba(0,0,0,.06); border: 2px dashed #777 !important; opacity: 1; }
/* Hide pointer-follow mirror */
.sortable-fallback{ opacity:0 !important; box-shadow:none !important; transform:none !important; }
.alarm-card.reorder-ready{ transform: translateY(-2px) scale(1.01); box-shadow:0 4px 10px rgba(0,0,0,.15); }
.alarm-card.dragging{ opacity:.95; box-shadow:0 8px 16px rgba(0,0,0,.25); }
.confirm-box{margin-top:8px;background:#fff1f1;border:1px solid #f44336;border-radius:6px;padding:8px;display:flex;justify-content:space-between;align-items:center;}
.confirm-actions{display:flex;gap:8px;}
.confirm-btn{height:28px;padding:0 10px;border-radius:6px;border:none;cursor:pointer;}
.confirm-btn.danger{background:#FFC6C6;}
.confirm-btn.ghost{background:#eee;}
.alarm-add{position:absolute;left:50%;bottom:60px;transform:translateX(-50%);width:64px;height:64px;border-radius:32px;background:#fff;border:none;box-shadow:0 2px 6px rgba(0,0,0,0.2);font-size:2rem;cursor:pointer;}

.alarm-form{position:absolute;inset:0;background:#d9d9d9;padding:40px 12px 50px;display:flex;flex-direction:column;gap:18px;}
.alarm-form.hidden{display:none;}
.time-row{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:16px;margin:8px 0;}
.ampm-group{display:flex;flex-direction:column;gap:6px;}
.ampm-btn{background:transparent;border:none;font-size:0.9rem;opacity:0.5;cursor:pointer;}
.ampm-btn.active{opacity:1;font-weight:700;}
.time-inputs{font-size:2rem;justify-self:center;}
.time-num{width:42px;border:none;background:transparent;border-bottom:1px solid transparent;text-align:center;font-size:2rem;outline:none;}
.time-num:focus{border-bottom-color:#000;}
.tilde{font-size:1.6rem;text-align:center;width:100%;}
.repeat-row{display:flex;align-items:center;gap:8px;margin-top:8px;}
.repeat-label{color:#555;font-size:0.85rem;}
.weekday-row{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;width:100%;}
.weekday-btn{width:100%;height:32px;border-radius:6px;border:1px solid #ddd;background:#fff;cursor:pointer;}
.weekday-btn.active{border-color:#2ecc71;color:#2ecc71;background:#fff;}
.save-row{position:absolute;left:0;right:0;bottom:80px;display:flex;justify-content:center;}
.alarm-save{width:100px;height:40px;background:#c8facc;border:none;border-radius:10px;cursor:pointer;font-size:1.05rem;}

.alarm-list{display:flex;flex-direction:column;gap:12px;padding-top:8px;}
.alarm-card{background:#fff;border-radius:8px;box-shadow:0 1px 2px rgba(0,0,0,0.06);padding:10px 12px;cursor:pointer;}
.alarm-days{display:flex;gap:6px;font-size:0.85rem;flex-wrap:wrap;color:#bbb;margin-bottom:6px;}
.alarm-days .day.active{color:#000;font-weight:700;}
.alarm-time-center{display:flex;justify-content:center;align-items:center;gap:8px;font-size:1.2rem;}
.alarm-time-center .ampm{font-size:0.9rem;color:#555;}
.alarm-time-center .tilde{margin:0 6px;}

/* 저장/취소 버튼 */
.save-row{position:absolute;left:0;right:0;bottom:80px;display:flex;justify-content:center;gap:10px;}
.alarm-save{width:100px;height:40px;background:#c8facc;border:none;border-radius:10px;cursor:pointer;font-size:1.05rem;}
.alarm-cancel{width:100px;height:40px;background:#FFC6C6;border:none;border-radius:10px;cursor:pointer;font-size:1.05rem;}

.settings-view{position:absolute;inset:0;background:#d9d9d9;padding:40px 12px 50px;overflow-y:auto;display:flex;flex-direction:column;gap:10px;}
.settings-view.hidden{display:none;}
.settings-login-card{background:#fff;border-radius:6px;padding:14px;display:flex;justify-content:flex-end;gap:8px;align-items:center;}
.settings-user-card{background:#f8f9fa;border:1px solid #e9ecef;border-radius:8px;padding:16px;margin:16px;text-align:left;}
.settings-user-card .settings-email{font-size:0.9rem;color:#495057;font-weight:500;}
.settings-item{background:#fff;border:1px solid #ccc;border-radius:6px;padding:12px 10px;display:flex;justify-content:space-between;align-items:center;cursor:pointer;}
.settings-item .muted{color:#999;font-size:0.85rem;}
.settings-sep{height:10px;background:#cfcfcf;border-radius:6px;}
.btn-outline{background:#fff;border:1px solid #bbb;border-radius:6px;padding:6px 10px;cursor:pointer;}

/* Login overlay */
.login-view{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.7);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:9999;
    backdrop-filter:blur(4px);
}
.login-view.visible{display:flex;}

.login-close{
    position:absolute;
    top:20px;
    right:20px;
    width:40px;
    height:40px;
    border-radius:20px;
    border:none;
    background:rgba(255,255,255,0.95);
    font-size:24px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 2px 8px rgba(0,0,0,0.2);
    z-index:10000;
}
.login-close:hover{background:rgba(255,255,255,1);}

.login-container{
    width:100%;
    max-width:380px;
    background:#fff;
    border-radius:16px;
    padding:32px 24px;
    box-shadow:0 8px 32px rgba(0,0,0,0.3);
    margin:20px;
}

.login-header{
    text-align:center;
    margin-bottom:32px;
}

.login-title{
    font-size:1.5rem;
    font-weight:600;
    color:#1a1a1a;
    margin:0;
}

.login-content{
    display:flex;
    flex-direction:column;
    gap:24px;
}

.social-login-section{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.social-btn{
    width:100%;
    height:52px;
    border:none;
    border-radius:12px;
    cursor:pointer;
    font-size:1rem;
    font-weight:500;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    transition:all 0.2s ease;
}

.social-btn:hover{
    transform:translateY(-1px);
    box-shadow:0 4px 12px rgba(0,0,0,0.15);
}

.social-btn.kakao{
    background:#FEE500;
    color:#3C1E1E;
}

.social-btn.naver{
    background:#03C75A;
    color:#fff;
}

.social-btn.google{
    background:#fff;
    border:1px solid #dadce0;
    color:#3c4043;
}

.social-icon{
    font-size:1.2rem;
    width:20px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.divider{
    position:relative;
    text-align:center;
    margin:8px 0;
}

.divider::before{
    content:'';
    position:absolute;
    top:50%;
    left:0;
    right:0;
    height:1px;
    background:#e0e0e0;
}

.divider span{
    background:#fff;
    padding:0 16px;
    color:#666;
    font-size:0.9rem;
}

.email-login-section{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.email-btn{
    width:100%;
    height:48px;
    border:none;
    border-radius:12px;
    cursor:pointer;
    font-size:1rem;
    font-weight:500;
    transition:all 0.2s ease;
}

.email-btn.primary{
    background:#007AFF;
    color:#fff;
}

.email-btn.primary:hover{
    background:#0056CC;
    transform:translateY(-1px);
}

.email-btn.secondary{
    background:#fff;
    border:1px solid #007AFF;
    color:#007AFF;
}

.email-btn.secondary:hover{
    background:#f0f8ff;
    transform:translateY(-1px);
}

.guest-section{
    text-align:center;
    margin-top:8px;
}

.guest-btn{
    background:none;
    border:none;
    color:#666;
    font-size:0.95rem;
    cursor:pointer;
    text-decoration:underline;
    padding:8px 16px;
}

.guest-btn:hover{
    color:#333;
}

.login-frame{
    width:min(100%,420px);
    height:80vh;
    border-radius:12px;
    background:#fff;
}

@media (max-width: 424px){
    .login-container{
        max-width:340px;
        padding:28px 20px;
        margin:16px;
    }
    
    .login-title{
        font-size:1.3rem;
    }
    
    .social-btn{
        height:48px;
        font-size:0.95rem;
    }
    
    .email-btn{
        height:44px;
        font-size:0.95rem;
    }
}

@media (min-width: 768px){
    .login-container{
        max-width:400px;
    }
}

