/* GmarketSans font-display:swap override — prevents FOIT on slow mobile connections */
@font-face {
  font-family: 'GmarketSans';
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url('https://webfontworld.github.io/gmarket/GmarketSansLight.woff2') format('woff2'),
       url('https://webfontworld.github.io/gmarket/GmarketSansLight.woff') format('woff');
}
@font-face {
  font-family: 'GmarketSans';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('https://webfontworld.github.io/gmarket/GmarketSansMedium.woff2') format('woff2'),
       url('https://webfontworld.github.io/gmarket/GmarketSansMedium.woff') format('woff');
}
@font-face {
  font-family: 'GmarketSans';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('https://webfontworld.github.io/gmarket/GmarketSansBold.woff2') format('woff2'),
       url('https://webfontworld.github.io/gmarket/GmarketSansBold.woff') format('woff');
}

:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --primary-color: #000000;
  --primary-hover: #333333;
  --secondary-color: #666666;
  --border-color: #000000;
  --panel-bg: #ffffff;
  --accent-color: #f0f0f0;
}

body {
  font-family: 'GmarketSans', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  letter-spacing: -0.02em;
}

header {
  text-align: center;
  padding: 4rem 1rem 3rem;
  background: white;
  position: relative;
}

.brand, .brand h1 {
  font-family: "Helvetica Neue", Helvetica, "Arial", sans-serif;
  font-size: 3.5rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.85;
  margin: 0;
  margin-bottom: 0.5rem;
  -webkit-text-stroke: 1.5px #000;
  display: block;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --primary-color: #ffffff;
    --primary-hover: #cccccc;
    --secondary-color: #aaaaaa;
    --border-color: #ffffff;
    --panel-bg: #1e1e1e;
    --accent-color: #2a2a2a;
  }
  header, .step-section, .canvas-wrapper, .magnifier-canvas {
    background: #121212 !important;
    border-color: #ffffff !important;
  }
  .brand {
    -webkit-text-stroke: 1.5px #fff;
  }
  .brand-kr, label, .hint, .input-desc, .status-msg, .empty-msg, .instruction, .tagline, .section-title h2, .main-label, .pattern-info-text, .history-panel h3, .legend-panel h3 {
    color: #ffffff !important;
  }
  select, input[type="number"] {
    color: #ffffff !important;
    border-color: #ffffff !important;
    background-color: #1e1e1e !important;
  }
  option {
    background-color: #1e1e1e;
    color: #ffffff;
  }
  .color-item, .seed-color-item, .history-item.active {
    border-color: #ffffff !important;
    color: #ffffff !important;
  }
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  }
  .primary-btn {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #fff !important;
  }
  .primary-btn:hover:not(:disabled) {
    background-color: #000 !important;
    color: #fff !important;
  }
  .secondary-btn {
    background-color: #121212 !important;
    color: #fff !important;
    border-color: #fff !important;
  }
  .secondary-btn:hover:not(:disabled) {
    background-color: #fff !important;
    color: #000 !important;
  }
  .generator-hint {
    background-color: #fff !important;
    color: #000 !important;
  }
  .section-title {
    border-bottom-color: #fff !important;
  }
  .seed-colors-area h3, .legend-panel h3 {
    border-left-color: #fff !important;
  }
  .placeholder-msg {
    color: #aaaaaa !important;
  }
}

.brand-kr {
  font-family: 'GmarketSans', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 1rem;
}

.container {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto 5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Unified Card Style */
.step-section {
  background: #ffffff;
  border: 2px solid #000000;
  padding: 2.5rem;
  width: 100%;
  box-sizing: border-box;
}

.section-title {
  margin-bottom: 2rem;
  text-align: left;
  border-bottom: 2px solid #000;
  padding-bottom: 0.75rem;
}

.section-title h2, .main-label {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
}

/* Step 1 label specific */
.main-label {
  display: block;
  text-align: left;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid #000;
  padding-bottom: 0.75rem;
}

.input-desc {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

/* Settings Grid - Explicit 3 Columns */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.unit-toggle {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
}

.unit-toggle label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.unit-toggle input[type="radio"] {
  width: 16px;
  height: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

select, input[type="number"] {
  padding: 1rem;
  border: 2px solid #000;
  border-radius: 0;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  appearance: none;
  color: #000000; /* Force black text color */
}

option {
  color: #000000; /* Ensure options are also black */
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

.input-with-hint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hint {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #000;
}

/* Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  width: 100%;
}

.generator-hint {
  background-color: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
}

button {
  padding: 1.2rem 3rem;
  border: 2px solid #000;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  max-width: 350px;
  letter-spacing: 0.05em;
}

.primary-btn {
  background-color: #000;
  color: #fff;
}

.primary-btn:hover:not(:disabled) {
  background-color: #fff;
  color: #000;
}

.secondary-btn {
  background-color: #fff;
  color: #000;
}

.secondary-btn:hover:not(:disabled) {
  background-color: #000;
  color: #fff;
}

.small-btn {
  padding: 0.6rem 1.5rem;
  font-size: 0.75rem;
  width: auto;
}

/* Canvas & Legend */
.canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  border: 2px solid #000;
  overflow: hidden; /* Prevent scrolling, force scaling */
  padding: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
  box-sizing: border-box;
}

canvas {
  max-width: 100%;
  max-height: 80vh; /* Limit height to fit screen */
  height: auto;
  width: auto;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  image-rendering: pixelated;
  cursor: crosshair;
  object-fit: contain; /* Ensure it fits aspect ratio */
}

/* Magnifier */
.magnifier-canvas {
  position: absolute;
  border: 2px solid #000;
  border-radius: 0; /* Square magnifier for hip look */
  box-shadow: 10px 10px 0px rgba(0,0,0,0.1);
  pointer-events: none;
  display: none;
  z-index: 100;
  background-color: #fff;
}

/* AI 피사체 분석 */
.ai-analysis-area {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color);
  background: var(--accent-color);
}
.ai-analysis-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.ai-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.ai-analysis-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ai-analysis-text {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
}
.ai-focus-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  flex-wrap: wrap;
}
.ai-focus-hint {
  font-size: 0.72rem;
  color: var(--secondary-color);
  font-weight: 400;
  width: 100%;
}

/* Color Lists */
.seed-colors-area h3, .legend-panel h3 {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  border-left: 4px solid #000;
  padding-left: 0.75rem;
}

.color-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.color-item, .seed-color-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 2px solid #000;
  padding: 0.5rem;
  font-family: monospace;
  font-size: 0.85rem;
}

.color-box {
  width: 28px;
  height: 28px;
  border: 2px solid #000;
  position: relative;
}

.removable-box:hover::after {
  content: "DEL";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 8px;
  font-weight: 900;
}

/* History */
.history-thumbnails {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0 2.5rem;
}

.history-item {
  width: 100px;
  height: 100px;
  border: 2px solid #eee;
  cursor: pointer;
  object-fit: cover;
  image-rendering: pixelated;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: #888;
}

.history-item.active {
  border: 4px solid #000;
  transform: scale(1.05);
}

.status-msg {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 1rem;
}

.empty-msg {
  color: var(--secondary-color);
  font-style: italic;
  grid-column: 1 / -1;
  white-space: nowrap;
}

/* Header top bar (globe | nav/hamburger) */
.header-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  z-index: 10;
}

.lang-selector {
  position: relative;
}

.lang-globe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid #000;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  color: inherit;
  line-height: 1;
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1.5px solid #000;
  flex-direction: column;
  min-width: 90px;
  z-index: 600;
}

.lang-dropdown.open {
  display: flex;
}

.lang-dropdown .lang-btn {
  border: none;
  border-bottom: 1px solid #eee;
  padding: 0.45rem 0.65rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  width: 100%;
  color: #000;
}

.lang-dropdown .lang-btn:last-child {
  border-bottom: none;
}

.lang-dropdown .lang-btn.active {
  background: #000;
  color: #fff;
}

.lang-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 800;
  border: 1.5px solid #000;
  background: #fff;
  cursor: pointer;
  width: auto;
}

.lang-btn.active {
  background: #000;
  color: #fff;
}

@media (max-width: 800px) {
  header {
    padding: 4rem 1rem 2.5rem;
  }
}

/* ==============================
   Auth Area (Header)
   ============================== */

.auth-area {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-email {
  font-size: 0.65rem;
  font-weight: 700;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.auth-area a.lang-btn,
.auth-user a.lang-btn {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}


@media (prefers-color-scheme: dark) {
  .lang-globe-btn {
    border-color: #fff;
    color: #e0e0e0;
  }
  .lang-dropdown {
    background: #1e1e1e;
    border-color: #fff;
  }
  .lang-dropdown .lang-btn {
    background: #1e1e1e;
    color: #e0e0e0;
    border-bottom-color: #333;
  }
  .lang-dropdown .lang-btn.active {
    background: #fff;
    color: #000;
  }
}

/* ==============================
   Login Modal
   ============================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-box {
  background: #fff;
  border: 2px solid #000;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-sizing: border-box;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  width: auto;
  line-height: 1;
  color: #000;
}

.modal-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #000;
}

.modal-tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  width: auto;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: #000;
  font-family: inherit;
}

.modal-tab.active {
  border-bottom-color: #000;
}

/* Social Login */
.social-login-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 0.05em;
  max-width: none;
  font-family: inherit;
  transition: all 0.2s;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #000;
}

.google-btn {
  background: #fff;
  color: #000;
}

.naver-btn {
  background-color: #03C75A;
  color: #fff;
}

.naver-btn:hover {
  background-color: #02b352;
}

.naver-icon {
  background: #fff;
  color: #03C75A;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  margin-right: 10px;
  border: 1px solid #000;
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
}

.modal-divider::before,
.modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ccc;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-form input {
  padding: 0.75rem 1rem;
  border: 2px solid #000;
  border-radius: 0;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: #000;
  font-family: inherit;
}

.auth-form input:focus {
  outline: none;
  box-shadow: 3px 3px 0 #000;
}

.auth-submit-btn {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  max-width: none;
  width: 100%;
}

.auth-error {
  margin-top: 1rem;
  padding: 0.6rem 0.75rem;
  background: #fff0f0;
  border: 1.5px solid #cc0000;
  color: #cc0000;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Dark mode - modal */
@media (prefers-color-scheme: dark) {
  .modal-box {
    background: #1e1e1e;
    border-color: #fff;
  }
  .modal-tab {
    color: #e0e0e0;
  }
  .modal-tab.active {
    border-bottom-color: #fff;
  }
  .modal-close {
    color: #e0e0e0;
  }
  .google-btn {
    background: #1e1e1e;
    color: #e0e0e0;
    border-color: #fff;
  }
  .google-btn:hover {
    background: #2a2a2a;
  }
  .modal-divider {
    color: #aaa;
  }
  .modal-divider::before,
  .modal-divider::after {
    background: #555;
  }
  .auth-form input {
    background: #121212;
    color: #e0e0e0;
    border-color: #fff;
  }
  .auth-error {
    background: #2a1111;
    border-color: #ff6666;
    color: #ff6666;
  }
  .auth-email {
    color: #e0e0e0;
  }
  .auth-area .lang-btn,
  .auth-area a.lang-btn,
  #authSignInBtn,
  #authSignOutBtn {
    background: #fff !important;
    color: #000 !important;
    border-color: #fff !important;
  }
}

/* ==============================
   Profile Setup Panel
   ============================== */

.profile-setup-header {
  margin-bottom: 1.25rem;
}

.profile-setup-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.3rem;
}

.profile-setup-desc {
  font-size: 0.8rem;
  color: #666;
  margin: 0;
}

.profile-photo-upload-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.profile-photo-preview {
  width: 60px;
  height: 60px;
  border: 2px solid #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  color: #aaa;
}

.nickname-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nickname-input-row {
  display: flex;
  gap: 0.5rem;
}

.nickname-input-row input {
  flex: 1;
  min-width: 0;
}

.nickname-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
}

.nickname-status.success {
  color: #007700;
  background: #f0fff0;
  border: 1px solid #007700;
}

.nickname-status.error {
  color: #cc0000;
  background: #fff0f0;
  border: 1px solid #cc0000;
}

@media (prefers-color-scheme: dark) {
  .profile-photo-preview {
    border-color: #fff;
    color: #777;
  }
  .profile-setup-desc {
    color: #aaa;
  }
  .nickname-status.success {
    color: #66ff66;
    background: #003300;
    border-color: #66ff66;
  }
  .nickname-status.error {
    color: #ff6666;
    background: #2a1111;
    border-color: #ff6666;
  }
}

/* ==============================
   My Patterns Page
   ============================== */

.mypage-container {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto 5rem;
}

.mypage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #000;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.mypage-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
  color: var(--text-color);
}

.mypage-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--secondary-color);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.pattern-card {
  border: 2px solid #000;
  background: var(--panel-bg);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.pattern-card:hover {
  box-shadow: 6px 6px 0 #000;
}

.pattern-card-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
  cursor: pointer;
  border-bottom: 2px solid #000;
}

.pattern-card-body {
  padding: 0.85rem 1rem;
}

.pattern-card-name {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-color);
}

.pattern-card-meta {
  font-size: 0.75rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.pattern-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pattern-card-actions button,
.pattern-card-actions a {
  padding: 0.35rem 0.65rem;
  font-size: 0.65rem;
  font-weight: 800;
  border: 1.5px solid #000;
  background: var(--panel-bg);
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-color);
  letter-spacing: 0.04em;
  width: auto;
  display: inline-block;
  font-family: inherit;
}

.pattern-card-actions button:hover,
.pattern-card-actions a:hover {
  background: #000;
  color: #fff;
}

.pattern-card-actions .delete-btn:hover {
  background: #cc0000;
  border-color: #cc0000;
  color: #fff;
}

.pattern-visibility-badge {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  border: 1.5px solid var(--border-color);
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0.6;
}


/* Dark mode - mypage */
@media (prefers-color-scheme: dark) {
  .pattern-card {
    border-color: #fff;
  }
  .pattern-card:hover {
    box-shadow: 6px 6px 0 #fff;
  }
  .pattern-card-thumb {
    border-bottom-color: #fff;
  }
  .pattern-card-actions button,
  .pattern-card-actions a {
    border-color: #fff;
  }
  .pattern-card-actions button:hover,
  .pattern-card-actions a:hover {
    background: #fff;
    color: #000;
  }
  .mypage-header {
    border-bottom-color: #fff;
  }
}


/* ==============================
   Site Footer
   ============================== */

.site-footer {
  border-top: 2px solid #000;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  background: #fff;
}

.footer-inner {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
  color: #000;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #000;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-biz {
  max-width: 1100px;
  width: 95%;
  margin: 1rem auto 0;
  padding-top: 0.75rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-biz-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-biz span {
  font-size: 0.7rem;
  color: #888;
  line-height: 1.5;
}

.footer-social {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #ccc;
  color: #555;
  text-decoration: none;
  transition: color 0.18s, border-color 0.18s;
}

.footer-social-link:hover {
  color: #000;
  border-color: #000;
}

@media (prefers-color-scheme: dark) {
  .footer-social-link {
    border-color: #555;
    color: #aaa;
  }
  .footer-social-link:hover {
    color: #fff;
    border-color: #fff;
  }
}

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .footer-biz {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .footer-social { margin-top: 0.25rem; }
}

@media (prefers-color-scheme: dark) {
  .site-footer {
    background: #121212;
    border-top-color: #fff;
  }
  .footer-brand,
  .footer-nav a {
    color: #e0e0e0;
  }
}

/* ==============================
   About Page
   ============================== */

.about-lead {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.about-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.about-feature {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.about-feature-icon {
  font-size: 1.2rem;
  font-weight: 900;
  min-width: 2rem;
  padding-top: 0.1rem;
}

.about-feature strong {
  display: block;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.about-feature p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--secondary-color);
}

.about-tech {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.about-tech h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.about-tech p {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--secondary-color);
}

.contact-content p {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.contact-email {
  font-size: 1rem;
}

.contact-email a {
  color: #000;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .contact-email a {
    color: #e0e0e0;
  }
}

/* ==============================
   Privacy Policy Page
   ============================== */

.policy-updated {
  font-size: 0.8rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

.policy-content h3 {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 2rem 0 0.75rem;
  border-left: 4px solid #000;
  padding-left: 0.75rem;
}

.policy-content p,
.policy-content li {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-color);
}

.policy-content ul {
  padding-left: 1.5rem;
  margin: 0.5rem 0 1rem;
}

.policy-content li {
  margin-bottom: 0.4rem;
}

.policy-content a {
  color: #000;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .policy-content h3 {
    border-left-color: #fff;
  }
  .policy-content a {
    color: #e0e0e0;
  }
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
  max-width: 560px;
}

.contact-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form-row label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-form-row input,
.contact-form-row textarea {
  padding: 0.75rem 1rem;
  border: 2px solid #000;
  border-radius: 0;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #000;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

.contact-form-row input:focus,
.contact-form-row textarea:focus {
  outline: none;
  box-shadow: 3px 3px 0 #000;
}

.contact-submit-btn {
  max-width: 160px;
  padding: 0.85rem 1rem;
}

.contact-success {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border: 2px solid #000;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (prefers-color-scheme: dark) {
  .contact-form-row input,
  .contact-form-row textarea {
    background: #121212;
    color: #e0e0e0;
    border-color: #fff;
  }
  .contact-form-row input:focus,
  .contact-form-row textarea:focus {
    box-shadow: 3px 3px 0 #fff;
  }
  .contact-success {
    border-color: #fff;
    color: #e0e0e0;
  }
}

/* Copyright Notice (upload section) */
.copyright-notice {
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: #fffbe6;
  border: 1.5px solid #e6c700;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.6;
  color: #5a4a00;
}

.copyright-notice a {
  color: #5a4a00;
  font-weight: 800;
  text-decoration: underline;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .copyright-notice {
    background: #2a2400;
    border-color: #c8a800;
    color: #f0d060;
  }
  .copyright-notice a {
    color: #f0d060;
  }
}


/* Cookie Consent Banner */
#cookieBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #000;
  color: #fff;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  z-index: 2000;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.3s ease;
}

.cookie-msg {
  flex: 1;
  min-width: 200px;
}

.cookie-btns {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-more {
  color: #ccc;
  text-decoration: underline;
  font-size: 0.75rem;
  white-space: nowrap;
}

.cookie-accept {
  background: #fff;
  color: #000;
  border: none;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  width: auto;
  letter-spacing: 0.05em;
  font-family: inherit;
}

.cookie-accept:hover {
  background: #ddd;
}

.contact-email-direct {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--secondary-color);
}

/* Custom File Upload Button */
.file-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.file-upload-btn {
  padding: 0.8rem 1.5rem;
  border: 2px solid #000;
  background-color: #fff;
  color: #000;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  line-height: 1;
}

.file-upload-btn:hover {
  background-color: #000;
  color: #fff;
}

.file-name-display {
  font-size: 0.8rem;
  color: var(--secondary-color);
  word-break: break-all;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Yarn Stash Styles ── */
.yarn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.yarn-item {
  border: 2px solid #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.yarn-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.yarn-item-photo {
  width: 100%;
  aspect-ratio: 1;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #eee;
  overflow: hidden;
}

.yarn-item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yarn-item-photo svg {
  color: #ccc;
}

.yarn-item-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.yarn-item-brand {
  font-size: 0.75rem;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
}

.yarn-item-name {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.yarn-item-meta {
  font-size: 0.8rem;
  color: #333;
}

.yarn-item-qty {
  margin-top: auto;
  padding-top: 0.5rem;
  font-weight: 700;
  color: var(--primary-color);
  font-size: 0.85rem;
}

.yarn-item-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  display: none;
  gap: 0.4rem;
}

.yarn-item:hover .yarn-item-actions {
  display: flex;
}

.yarn-action-btn {
  width: 28px;
  height: 28px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.yarn-action-btn:hover {
  background: #000;
  color: #fff;
}

.yarn-action-btn.del:hover {
  background: #dc3545;
  border-color: #dc3545;
}

@media (prefers-color-scheme: dark) {
  .file-upload-btn {
    background-color: #121212;
    color: #fff;
    border-color: #fff;
  }
  .file-upload-btn:hover {
    background-color: #fff;
    color: #000;
  }
}

/* ==============================
   Mypage 4-Tab Layout
   ============================== */

.mypage-tabs {
  display: flex;
  border-bottom: 2px solid #000;
  margin-bottom: 2rem;
  gap: 0;
  overflow-x: auto;
}

.mypage-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
  color: var(--secondary-color);
  font-family: inherit;
  width: auto;
}

.mypage-tab.active {
  color: var(--text-color);
  border-bottom-color: var(--text-color);
}

.mypage-panel {
  display: none;
}

.mypage-panel.active {
  display: block;
}

/* Profile Edit */
.profile-edit-section {
  max-width: 480px;
  padding: 1.5rem 0;
}

.profile-edit-avatar-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-edit-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-edit-avatar-cam {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid #fff;
}

.profile-edit-avatar {
  width: 80px;
  height: 80px;
  border: 2px solid #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  color: #aaa;
  flex-shrink: 0;
}

.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.profile-edit-save-btn {
  margin-top: 0.25rem;
  width: 100%;
}

.mp-withdrawal-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f0f0f0;
}

.mp-withdrawal-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s;
}

.mp-withdrawal-btn:hover {
  color: #888;
}

.profile-edit-form input[type="text"] {
  padding: 0.75rem 1rem;
  border: 2px solid #000;
  border-radius: 0;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: #000;
  font-family: inherit;
}

.profile-edit-form input[type="text"]:focus {
  outline: none;
  box-shadow: 3px 3px 0 #000;
}

.profile-edit-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.write-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.4rem;
}

@media (prefers-color-scheme: dark) {
  .mypage-tabs {
    border-bottom-color: #fff;
  }
  .mypage-tab.active {
    border-bottom-color: #fff;
  }
  .profile-edit-avatar {
    border-color: #fff;
    color: #777;
  }
  .profile-edit-form input[type="text"] {
    background: #121212;
    color: #e0e0e0;
    border-color: #fff;
  }
  .profile-edit-form input[type="text"]:focus {
    box-shadow: 3px 3px 0 #fff;
  }
}

/* ==============================
   Community Feed
   ============================== */

.community-container {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto 5rem;
}

.community-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tag-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
}

.tag-chip {
  padding: 0.35rem 0.85rem;
  border: 1.5px solid #000;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 0.03em;
  width: auto;
  font-family: inherit;
  color: #000;
}

.tag-chip.active {
  background: #000;
  color: #fff;
}

.tag-chip:hover:not(.active) {
  background: #f0f0f0;
}

.write-btn {
  flex-shrink: 0;
  max-width: 100px;
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
}

/* Post Grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.post-card {
  border: 2px solid #000;
  background: var(--panel-bg);
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-card:hover {
  box-shadow: 5px 5px 0 #000;
  transform: translate(-2px, -2px);
}

.post-card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid #000;
}

.post-card-thumb-empty {
  background: var(--accent-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem;
}

.post-card-thumb-tag {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1.5px solid rgba(0,0,0,0.35);
  padding: 0.1rem 0.4rem;
  color: rgba(0,0,0,0.5);
}

.post-card-thumb-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  color: #000;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-body {
  padding: 0.85rem 1rem;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.post-card-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid #000;
  padding: 0.15rem 0.4rem;
  color: var(--text-color);
}

.post-card-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-color);
}

.post-card-meta {
  font-size: 0.7rem;
  color: var(--secondary-color);
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.post-card-avatar-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  background-size: cover;
  background-position: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  flex-shrink: 0;
  overflow: hidden;
}

.post-card-date, .post-card-counts {
  color: var(--secondary-color);
}

/* Write Modal */
.write-modal {
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.write-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.write-form input[type="text"],
.write-form textarea,
.write-form select {
  padding: 0.75rem 1rem;
  border: 2px solid #000;
  border-radius: 0;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #000;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

.write-form input[type="text"]:focus,
.write-form textarea:focus,
.write-form select:focus {
  outline: none;
  box-shadow: 3px 3px 0 #000;
}

.image-upload-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.image-slot {
  aspect-ratio: 1;
  border: 2px dashed #999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: var(--accent-color);
}

.image-slot label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--secondary-color);
  text-align: center;
}

.image-slot label input[type="file"] {
  display: none;
}

.img-slot-preview {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.img-slot-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  font-size: 1rem;
  line-height: 1;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  min-width: 0;
}

.tag-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.6rem;
  border: 1.5px solid #000;
  background: var(--panel-bg);
  color: var(--text-color);
}

.tag-checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

@media (prefers-color-scheme: dark) {
  .tag-chip {
    background: #121212;
    color: #e0e0e0;
    border-color: #fff;
  }
  .tag-chip.active {
    background: #fff;
    color: #000;
  }
  .tag-chip:hover:not(.active) {
    background: #2a2a2a;
  }
  .post-card {
    border-color: #fff;
  }
  .post-card:hover {
    box-shadow: 6px 6px 0 #fff;
  }
  .post-card-thumb {
    border-bottom-color: #fff;
  }
  .post-card-tag {
    border-color: #fff;
    color: #e0e0e0;
  }
  .write-form input[type="text"],
  .write-form textarea,
  .write-form select {
    background: #121212;
    color: #e0e0e0;
    border-color: #fff;
  }
  .write-form input[type="text"]:focus,
  .write-form textarea:focus,
  .write-form select:focus {
    box-shadow: 3px 3px 0 #fff;
  }
  .image-slot {
    border-color: #555;
  }
  .tag-checkbox-label {
    border-color: #fff;
  }
}

/* ==============================
   Post Detail Page
   ============================== */

.post-detail-container {
  max-width: 760px;
  width: 95%;
  margin: 0 auto 5rem;
}

.post-detail-header {
  border-bottom: 2px solid #000;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.post-detail-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0.75rem 0;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-color);
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.post-author-avatar {
  width: 36px;
  height: 36px;
  border: 2px solid #000;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  flex-shrink: 0;
  overflow: hidden;
}

.post-author-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-color);
}

.post-author-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.post-author-link:hover .post-author-name {
  text-decoration: underline;
}

/* 타인 프로필 헤더 */
.other-profile-header {
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0 1.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}
.other-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  flex-shrink: 0;
  overflow: hidden;
}
.other-profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.other-profile-nickname {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}

/* community 피드 - 작성자 이름 클릭 */
.post-card-author-link {
  cursor: pointer;
}
.post-card-author-link:hover {
  text-decoration: underline;
}

.post-date {
  font-size: 0.75rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin-left: 0.5rem;
}

.post-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.gallery-img {
  width: calc(50% - 0.25rem);
  max-width: 360px;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 2px solid #000;
  cursor: pointer;
  transition: opacity 0.2s;
}

.gallery-img:only-child {
  width: 100%;
  max-width: 100%;
}

.gallery-img:hover {
  opacity: 0.85;
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.post-linked-pattern {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border: 2px solid #000;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.post-linked-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary-color);
  white-space: nowrap;
  padding-top: 0.2rem;
}

.post-linked-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.post-linked-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  image-rendering: pixelated;
  border: 1px solid #000;
  flex-shrink: 0;
}

.post-linked-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.post-linked-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-linked-meta {
  font-size: 0.78rem;
  color: var(--secondary-color);
  margin: 0;
}

.post-linked-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.post-action-bar {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  margin-bottom: 2rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 2px solid #000;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  width: auto;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-color);
  font-family: inherit;
}

.action-btn:hover,
.action-btn.active {
  background: #000;
  color: #fff;
}

.action-icon {
  font-size: 1rem;
}

/* Comments */
.comments-section {
  margin-top: 2rem;
}

.comments-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  border-left: 4px solid #000;
  padding-left: 0.75rem;
}

.comment-item {
  border-bottom: 1px solid var(--accent-color);
  padding: 0.85rem 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border: 1.5px solid #000;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  flex-shrink: 0;
  overflow: hidden;
}

.comment-author {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-color);
}

.comment-date {
  font-size: 0.72rem;
  color: var(--secondary-color);
  font-weight: 600;
}

.comment-body {
  font-size: 0.88rem;
  line-height: 1.7;
  margin: 0;
  color: var(--text-color);
  white-space: pre-wrap;
  word-break: break-word;
  padding-left: 2rem;
}

.comment-delete-btn {
  margin-left: auto;
  font-size: 0.7rem;
  color: #cc0000;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: auto;
  font-family: inherit;
  font-weight: 700;
}

.comment-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.2rem;
  padding-left: 2rem;
}

.reply-btn, .comment-edit-btn {
  font-size: 0.72rem;
  color: var(--secondary-color);
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.reply-btn:hover, .comment-edit-btn:hover {
  color: var(--text-color);
  text-decoration: underline;
}

.comment-edit-area {
  margin-top: 0.4rem;
}

.reply-form {
  margin-top: 0.5rem;
  margin-left: 2rem;
}
.reply-input {
  width: 100%;
  resize: vertical;
  border: 1.5px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  box-sizing: border-box;
  background: var(--bg-color);
  color: var(--text-color);
}
.reply-form-btns {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
  justify-content: flex-end;
}

.replies-container {
  margin-top: 0.25rem;
}
.reply-item {
  margin-left: 2rem;
  border-left: 2px solid var(--accent-color);
  padding: 0.5rem 0 0.25rem 0.75rem;
  margin-top: 0.5rem;
}
@media (prefers-color-scheme: dark) {
  .reply-input {
    border-color: #fff;
  }
  .reply-item {
    border-left-color: #444;
  }
}

.comment-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  align-items: flex-start;
}

.comment-form textarea {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #000;
  border-radius: 0;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
  color: #000;
  resize: none;
  box-sizing: border-box;
}

.comment-form textarea:focus {
  outline: none;
  box-shadow: 3px 3px 0 #000;
}

.comment-submit-btn {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
}

.post-comment-login {
  font-size: 0.85rem;
  color: var(--secondary-color);
  margin-top: 1rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-color);
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  width: auto;
}

@media (prefers-color-scheme: dark) {
  .post-detail-header {
    border-bottom-color: #fff;
  }
  .post-author-avatar {
    border-color: #fff;
    color: #777;
  }
  .gallery-img {
    border-color: #fff;
  }
  .post-linked-pattern {
    border-color: #fff;
  }
  .post-linked-thumb {
    border-color: #fff;
  }
  .post-action-bar {
    border-color: #fff;
  }
  .action-btn {
    border-color: #fff;
    color: #e0e0e0;
  }
  .action-btn:hover,
  .action-btn.active {
    background: #fff;
    color: #000;
  }
  .comments-title {
    border-left-color: #fff;
  }
  .comment-avatar {
    border-color: #fff;
    color: #777;
  }
  .comment-form textarea {
    background: #121212;
    color: #e0e0e0;
    border-color: #fff;
  }
  .comment-form textarea:focus {
    box-shadow: 3px 3px 0 #fff;
  }
}

/* ==============================
   Mypage V2 Enhanced UI
   ============================== */

.mypage-header-v2 {
  background: var(--panel-bg);
  border: 2px solid var(--border-color);
  padding: 2.5rem;
  margin-bottom: 2rem;
}

.profile-main {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.profile-avatar-lg {
  width: 120px;
  height: 120px;
  border: 3px solid var(--border-color);
  background-color: var(--accent-color);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  flex-shrink: 0;
}

.profile-info-lg {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-info-lg h2 {
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-color);
}

.profile-bio-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--secondary-color);
  margin: 0;
  max-width: 500px;
  word-break: break-word;
}

.profile-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 0.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-color);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--secondary-color);
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 30px;
  background-color: var(--border-color);
  opacity: 0.2;
}

.mypage-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.mypage-panel-header h1 {
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
  color: var(--text-color);
}

@media (max-width: 768px) {
  .profile-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .profile-avatar-lg {
    width: 90px;
    height: 90px;
  }
  .profile-info-lg h2 {
    font-size: 1.5rem;
  }
  .profile-stats {
    gap: 1.5rem;
  }
}


/* ═══════════════════════════════════════════════════════════════
   REDESIGNED STICKY HEADER  (overrides old header {} styles)
═══════════════════════════════════════════════════════════════ */
header {
  text-align: left;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 2px solid #000;
  height: 56px;
}
@media (prefers-color-scheme: dark) {
  header { background: #121212; border-bottom-color: #fff; }
}
.hdr-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Logo */
.hdr-logo {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  -webkit-text-stroke: 1.5px #000;
  color: #000;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-shrink: 0;
  margin-right: 2rem;
}
.hdr-logo-kr {
  font-family: 'GmarketSans', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  -webkit-text-stroke: 0;
  letter-spacing: 0.02em;
  color: #888;
}
@media (prefers-color-scheme: dark) {
  .hdr-logo { -webkit-text-stroke-color: #fff; color: #fff; }
  .hdr-logo-kr { color: #aaa; }
}

/* GNB (Global Navigation Bar) */
.gnb {
  display: flex;
  align-items: stretch;
  height: 100%;
  flex: 1;
}
.gnb-item {
  position: relative;
  display: flex;
  align-items: center;
}
.gnb-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 18px;
  height: 56px;
  font-family: 'GmarketSans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: none;
  transition: background 0.12s;
}
.gnb-link:hover { background: #f5f5f5; }
.gnb-item:hover > .gnb-link { background: #f5f5f5; }
.gnb-chevron {
  width: 11px; height: 11px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.gnb-item:hover .gnb-chevron { transform: rotate(180deg); }

/* GNB Dropdown */
.gnb-sub {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 2px solid #000;
  border-top: none;
  min-width: 170px;
  display: none;
  z-index: 999;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.08);
}
.gnb-item:hover .gnb-sub { display: block; }
.gnb-sub.open { display: block; }
.gnb-sub-link {
  display: block;
  padding: 0.75rem 1.1rem;
  font-family: 'GmarketSans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #eee;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  cursor: pointer;
}
.gnb-sub-link:last-child { border-bottom: none; }
.gnb-sub-link:hover { background: #000; color: #fff; }
@media (prefers-color-scheme: dark) {
  .gnb-link { color: #e0e0e0; }
  .gnb-link:hover, .gnb-item:hover > .gnb-link { background: #1e1e1e; }
  .gnb-sub { background: #1e1e1e; border-color: #fff; }
  .gnb-sub-link { color: #e0e0e0; border-bottom-color: #333; }
  .gnb-sub-link:hover { background: #fff; color: #000; }
}

/* Header right area */
.hdr-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════
   SCROLL-TO-TOP BUTTON
═══════════════════════════════════════════════════════════════ */
.scroll-top-btn {
  position: fixed;
  right: 24px;
  bottom: 32px;
  width: 44px;
  height: 44px;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
}
.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover { background: #333; }
.scroll-top-btn svg {
  width: 18px; height: 18px;
  stroke: #fff; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
@media (prefers-color-scheme: dark) {
  .scroll-top-btn { background: #fff; }
  .scroll-top-btn svg { stroke: #000; }
  .scroll-top-btn:hover { background: #ccc; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — scrollable GNB on mobile
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .scroll-top-btn { right: 16px; bottom: 24px; width: 40px; height: 40px; }
}

@media (max-width: 1024px) {
  header {
    height: auto;
    padding: 0.75rem 1.5rem 0 !important;
  }
  .hdr-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
    height: auto;
  }
  .hdr-logo { margin-bottom: 0.5rem; }
  .hdr-right { margin-bottom: 0.5rem; }
  .gnb {
    flex: 1 1 100%;
    order: 3;
    display: flex !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
  }
  .gnb::-webkit-scrollbar { display: none; }
  .gnb-link { height: 44px; padding: 0 12px; font-size: 0.85rem; }
  
  .hdr-right .lang-selector { display: block !important; }
}

/* 2. Mobile header padding 리셋 (old 4rem 룰 덮어쓰기) */
@media (max-width: 800px) {
  header { padding: 0 !important; }
}

/* 3. Globe 버튼 — 새 헤더에서 테두리 제거 */
header .lang-globe-btn {
  border: none;
  padding: 6px;
  font-size: 0;
}
header .lang-globe-btn:hover { background: #f0f0f0; }

/* 4. 홈 사이드바 — sticky 헤더(56px) 아래 고정 */
.home-sidebar {
  top: 56px !important;
  height: calc(100vh - 56px) !important;
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT SPACING — 헤더 아래 여백
═══════════════════════════════════════════════════════════════ */
.container,
.community-container,
.post-detail-container,
.mypage-container,
.mypage-wrap,
.profile-main,
.page-wrap,
.notice-wrap,
.about-wrap,
.terms-wrap,
.privacy-wrap,
.guide-wrap,
.toolkit-wrap,
.magazine-wrap {
  padding-top: 2rem;
}

/* ═══════════════════════════════════════════════════════════════
   REMOVE SQUARE BORDERS — 각 페이지 사각형 틀 제거
═══════════════════════════════════════════════════════════════ */

/* Pattern generator step sections — 4면 박스 → 하단 구분선만 */
.step-section {
  border: none !important;
  border-bottom: 1px solid #e8e8e8 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}
.step-section:last-child {
  border-bottom: none !important;
}

/* Container top spacing — 헤더 아래 충분한 여백 */
.container {
  padding-top: 2.5rem !important;
}
.community-container {
  padding-top: 2rem !important;
}
.post-detail-container {
  padding-top: 2rem !important;
}
.mypage-container {
  padding-top: 2rem !important;
}

/* ═══════════════════════════════════════════════════════════════
   MAGAZINE SHARE BAR
═══════════════════════════════════════════════════════════════ */
.mag-share-bar {
  display: flex;
  padding: 1.25rem 0;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  margin-bottom: 2rem;
}
.mag-share-bar .action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==============================
   MyPage v2 — 사이드바 레이아웃
   ============================== */

.mp-page-wrap {
  min-height: 60vh;
}

.mp-guest {
  max-width: 600px;
  margin: 4rem auto;
  padding: 0 1rem;
}

.mp-layout {
  display: flex;
  gap: 2rem;
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
  padding: 1.75rem 0 3rem;
  align-items: flex-start;
}

/* ── 사이드바 ── */
.mp-sidebar {
  width: 180px;
  flex-shrink: 0;
  position: sticky;
  top: 4.5rem;
}

.mp-user-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1rem;
  margin-bottom: 0;
  border-bottom: none;
}

.mp-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #f0f0f0;
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.mp-user-info { width: 100%; }

.mp-nickname {
  font-weight: 800;
  font-size: 0.95rem;
  word-break: break-all;
  margin-top: 0.1rem;
}

.mp-joined {
  font-size: 0.67rem;
  color: #aaa;
  margin-top: 0.2rem;
  letter-spacing: 0.01em;
}

.mp-bio {
  font-size: 0.75rem;
  color: #555;
  line-height: 1.5;
  margin: 0.6rem 0 0.75rem;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.mp-bio.expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.mp-bio-toggle {
  display: block;
  text-align: center;
  font-size: 0.68rem;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: -0.4rem 0 0.5rem;
  font-family: inherit;
  text-decoration: underline;
}

.mp-stats-row {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 0.75rem 0 0.9rem;
  padding: 0.75rem 0 0.9rem;
  border-top: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
}

.mp-stat {
  text-align: center;
  flex: 1;
  padding: 0.1rem 0.5rem;
}

.mp-stat + .mp-stat {
  border-left: 1px solid #ccc;
}

.mp-stat-val { display: block; font-weight: 800; font-size: 1.1rem; line-height: 1.15; }
.mp-stat-lbl { display: block; font-size: 0.6rem; color: #999; margin-top: 0.1rem; }

.mp-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mp-nav-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  border-radius: 0;
  color: #888;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}
.mp-nav-btn:hover { color: #000; }
.mp-nav-btn.active { color: #000; font-weight: 700; border-left-color: #000; }

/* ── 콘텐츠 영역 ── */
.mp-content {
  flex: 1;
  min-width: 0;
}

.mp-panel { display: none; }
.mp-panel.active { display: block; }

.mp-panel-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #000;
}

.mp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.mp-panel-header .mp-panel-title { margin-bottom: 0; }

/* ── 서브탭 (내 글·댓글) ── */
.mp-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #000;
  margin-bottom: 1.5rem;
}

.mp-subtab {
  background: none;
  border: none;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  color: #888;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.mp-subtab.active { color: #000; font-weight: 700; border-bottom-color: #000; }
.mp-subtab:hover { color: #000; }

/* ── 프로젝트 카드 ── */
.mp-project-card {
  border-bottom: 1px solid #e8e8e8;
  padding: 1.25rem 0;
}
.mp-project-card:last-child { border-bottom: none; }
.mp-project-done .mp-project-name { color: #aaa; }

.mp-project-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.mp-project-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.mp-project-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: #000;
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.mp-project-meta {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 0.6rem;
}

.mp-progress-bar-wrap {
  height: 6px;
  background: #e8e8e8;
  border-radius: 3px;
  margin-bottom: 0.3rem;
  overflow: hidden;
}
.mp-progress-bar {
  height: 100%;
  background: #000;
  border-radius: 3px;
  transition: width 0.3s;
}
.mp-progress-pct {
  font-size: 0.75rem;
  color: #666;
  display: block;
  margin-bottom: 0.6rem;
}

.mp-project-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mp-section-sub {
  font-size: 1rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: #555;
}

/* ── 댓글 아이템 ── */
.mp-comment-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1rem 0;
  border-bottom: 1px solid #e8e8e8;
  transition: background 0.1s;
}
.mp-comment-item:last-child { border-bottom: none; }
.mp-comment-item:hover { background: #fafafa; }

.mp-comment-content {
  font-size: 0.9rem;
  margin: 0 0 0.3rem;
  color: #222;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mp-comment-meta {
  font-size: 0.75rem;
  color: #aaa;
}

/* ── 스크랩 취소 버튼 ── */
.mp-unscrap-btn {
  margin-top: 0.5rem;
  background: none;
  border: 1px solid #ddd;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: #888;
  border-radius: 4px;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.mp-unscrap-btn:hover { border-color: #000; color: #000; }

/* ── 반응형 ── */
@media (max-width: 768px) {
  .mp-layout {
    flex-direction: column;
    gap: 0;
    padding: 0 0 3rem;
    width: 100%;
  }

  .mp-sidebar {
    width: 100%;
    position: static;
    border-bottom: 2px solid #000;
    padding: 1rem 4% 0;
  }

  .mp-user-summary {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 1rem;
    padding-bottom: 1rem;
  }

  .mp-avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .mp-bio {
    text-align: left;
    margin: 0.5rem 0 0.6rem;
  }

  .mp-bio-toggle {
    text-align: left;
  }

  .mp-stats-row {
    justify-content: flex-start;
    margin: 0.5rem 0 0;
    padding: 0.6rem 0 0.5rem;
    border-bottom: none;
  }

  .mp-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mp-nav::-webkit-scrollbar { display: none; }

  .mp-nav-btn {
    white-space: nowrap;
    padding: 0.65rem 1rem;
    border-radius: 0;
    border-left: none;
    border-bottom: 3px solid transparent;
    font-size: 0.85rem;
  }
  .mp-nav-btn.active {
    background: none;
    color: #000;
    font-weight: 700;
    border-bottom-color: #000;
  }

  .mp-content {
    padding: 1.5rem 4%;
  }
}

/* ─── COLOR PALETTE PAGE ───────────────────────────────────────────────────── */

.cp-wrap {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto 5rem;
  padding-top: 2rem;
}

.cp-header {
  margin-bottom: 2rem;
}
.cp-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.cp-subtitle {
  font-size: 0.95rem;
  color: #777;
  margin: 0;
}

/* Tabs */
.cp-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e8e8e8;
  margin-bottom: 2.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tab {
  background: none;
  border: none;
  padding: 0.85rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.cp-tab.active, .cp-tab:hover {
  color: #000;
  border-bottom-color: #000;
}

/* Panels */
.cp-panel { display: none; }
.cp-panel.active { display: block; }

/* Section labels */
.cp-section-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #555;
  margin-bottom: 0.6rem;
}

/* Simulator layout */
.cp-sim-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.cp-sim-left {
  flex: 0 0 320px;
  min-width: 0;
}
.cp-sim-right {
  flex: 1 1 380px;
  min-width: 0;
}

/* Canvas */
.cp-preview-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  background: #f5f5f5;
}

/* Color slots */
.cp-color-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.cp-slot-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: opacity 0.15s;
}
.cp-drag-handle {
  cursor: grab;
  font-size: 1.1rem;
  color: #bbb;
  flex-shrink: 0;
  padding: 0 2px;
  user-select: none;
  touch-action: none;
}
.cp-drag-handle:active {
  cursor: grabbing;
}
.cp-slot-drag-over {
  outline: 2px dashed #000;
  outline-offset: 2px;
  background: #f5f5f5;
}
.cp-color-input {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}
.cp-hex-input {
  flex: 1;
  font-size: 0.88rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: monospace;
}
.cp-slot-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.12);
}

.cp-slot-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

/* Texture tabs */
.cp-texture-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.cp-texture-tab,
.cp-texture-btn {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.cp-texture-tab.active,
.cp-texture-btn.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* Stripe sliders */
.cp-stripe-controls { margin-bottom: 0.75rem; }
.cp-stripe-slider-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.cp-stripe-slider-row input[type=range] {
  flex: 1;
}
.cp-stripe-rows-val {
  font-size: 0.8rem;
  color: #666;
  min-width: 2.5rem;
  text-align: right;
}

/* Contrast box */
.cp-contrast-box {
  background: #f8f8f8;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.cp-contrast-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.15rem 0;
}
.cp-contrast-comment {
  font-size: 0.82rem;
  color: #666;
}
.cp-contrast-comment.good { color: #2d8a4e; }
.cp-contrast-comment.ok   { color: #7a6a00; }
.cp-contrast-comment.warn { color: #b45309; }
.cp-contrast-comment.poor { color: #c0392b; }
/* simContrast 단일 요소 스타일 */
#simContrast {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
}

/* CVD buttons */
.cp-cvd-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}
.cp-cvd-btn {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background .12s;
}
.cp-cvd-btn.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.cp-save-btn {
  width: 100%;
  margin-top: 0.75rem;
}

/* Recommendation layout */
.cp-rec-controls {
  background: #f8f8f8;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.cp-rec-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.cp-rec-field {
  flex: 1 1 200px;
  min-width: 0;
}
.cp-select {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.88rem;
  background: #fff;
}
.cp-number-input {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.88rem;
}
.cp-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cp-filter-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 0.32rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background .12s;
}
.cp-filter-btn.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* Palette grid */
.cp-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.cp-palette-card {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 1.25rem;
  background: #fff;
  transition: box-shadow .15s;
}
.cp-palette-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.cp-palette-swatches {
  display: flex;
  gap: 5px;
  margin-bottom: 0.75rem;
}
.cp-palette-swatch {
  flex: 1;
  height: 40px;
  border-radius: 6px;
  display: block;
  border: 1px solid rgba(0,0,0,.06);
  min-width: 0;
}
.cp-palette-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}
.cp-palette-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}
.cp-palette-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Stripe calculator */
.cp-stripe-calc-layout {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.cp-stripe-calc-left {
  flex: 0 0 320px;
  min-width: 0;
}
.cp-stripe-calc-right {
  flex: 1 1 380px;
  min-width: 0;
}

.cp-stripe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.cp-stripe-table th,
.cp-stripe-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e8e8e8;
  text-align: left;
}
.cp-stripe-table th {
  font-weight: 700;
  background: #f8f8f8;
}
.cp-stripe-swatch-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cp-stripe-swatch-cell .cp-slot-swatch {
  width: 20px;
  height: 20px;
}

/* Curation filter */
.cp-cur-filters {
  margin-bottom: 2rem;
}

/* Toast */
.cp-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 0.7rem 1.5rem;
  border-radius: 24px;
  font-size: 0.9rem;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.cp-toast.cp-toast-info {
  background: #1a3a5c;
}

/* Mypage palette card */
.mp-palette-card {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 1rem;
}

/* 팔레트 공개/비공개 뱃지 */
.mp-palette-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-public {
  background: #e6f4ea;
  color: #2d7d3a;
  border: 1px solid #b7dfc0;
}
.badge-private {
  background: #f5f5f5;
  color: #888;
  border: 1px solid #ddd;
}

@media (max-width: 640px) {
  .cp-sim-layout,
  .cp-stripe-calc-layout {
    flex-direction: column;
    gap: 1.5rem;
  }
  .cp-sim-left,
  .cp-stripe-calc-left {
    flex: none;
    width: 100%;
  }
  .cp-sim-right,
  .cp-stripe-calc-right {
    flex: none;
    width: 100%;
  }
  .cp-palette-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
  .cp-tab {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }
  .cp-wrap {
    padding-top: 1.5rem;
  }
  .cp-rec-controls {
    padding: 1rem;
  }
  .cp-rec-row {
    gap: 1rem;
  }
}

/* ── Pattern Generator Tabs ── */
.tab-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 700;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s;
}
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.tab-panel {
    display: none !important;
}
.tab-panel.active {
    display: block !important;
}

/* ── Filet Editor ── */
.filet-editor-section {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.filet-canvas {
    display: block;
    max-width: none;
    width: auto;
    height: auto;
    image-rendering: auto;
    background: #fff;
    cursor: crosshair;
    border: 1px solid #ccc;
}
.dual-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dual-input input {
    width: 80px;
}
.gauge-input-row {
    display: flex;
    gap: 1rem;
}
.result-size-box {
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
}
.filet-wrapper {
    display: block;
    overflow: auto;
    padding: 1rem;
    border-radius: 8px;
    background: #f0f0f0;
}

/* ==============================
   Breadcrumbs
   ============================== */
.breadcrumbs {
  max-width: 1100px;
  width: 95%;
  margin: 1rem auto 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  list-style: none;
  padding: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  font-size: 0.7rem;
  color: #ccc;
}

.breadcrumbs a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

.breadcrumbs .current {
  color: var(--primary-color);
  pointer-events: none;
}

@media (max-width: 800px) {
  .breadcrumbs {
    margin-top: 0.5rem;
    font-size: 0.7rem;
  }
}

/* ==============================
   Notice / Accordion Styles
   ============================== */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 2rem; /* 늘어난 간격 */
}

.notice-item {
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-color);
  overflow: hidden;
  transition: all 0.2s ease;
  margin-bottom: 1rem; /* 안드로이드 웹뷰 등 구버전 flex gap 대체용 */
}

.notice-summary {
  padding: 1.5rem 1.75rem;
  cursor: pointer;
  list-style: none; /* Hide default triangle */
  position: relative;
  transition: background-color 0.2s;
  outline: none;
}

.notice-summary::-webkit-details-marker {
  display: none;
}

.notice-summary:hover {
  background: var(--accent-color);
}

.notice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.notice-badge {
  background: var(--primary-color);
  color: var(--bg-color);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.notice-time {
  font-size: 0.8rem;
  color: var(--secondary-color);
}

.notice-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.notice-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.5;
  color: var(--text-color);
  flex: 1;
}

.notice-icon {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--secondary-color);
  transition: transform 0.3s ease;
  user-select: none;
}

.notice-item[open] .notice-icon {
  transform: rotate(180deg);
}

.notice-body {
  padding: 0 1.75rem 1.5rem 1.75rem;
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--secondary-color);
  border-top: 1px dashed var(--border-color);
  margin-top: 0;
  padding-top: 1.5rem;
}

/* ==============================
   Clickable Stats (Mypage)
   ============================== */
.clickable-stat {
  cursor: pointer;
  transition: opacity 0.2s;
}
.clickable-stat:hover {
  opacity: 0.7;
}
.clickable-stat:hover .mp-stat-val {
  text-decoration: underline;
  text-underline-offset: 4px;
}

