.portal-home .home-todo-panel {
  display: grid;
  gap: 9px;
  padding: 14px 16px 11px;
  border: 1px solid rgba(61, 54, 49, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(180deg, #ece7e3, #ddd7d2);
  box-shadow: 0 16px 28px rgba(58, 49, 43, 0.12);
}

.portal-home .home-todo-head,
.portal-home .home-todo-title-line,
.portal-home .home-todo-actions {
  display: flex;
  align-items: center;
}

.portal-home .home-todo-head {
  justify-content: space-between;
  gap: 18px;
}

.portal-home .home-todo-title-line {
  gap: 8px;
}

.portal-home .home-todo-title-line h2 {
  margin: 0;
  color: #252a2f;
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1;
}

.portal-home .home-todo-count {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #252a2f;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.portal-home .home-todo-actions {
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.portal-home .home-todo-user,
.portal-home .home-todo-new,
.portal-home .home-todo-open {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid rgba(37, 42, 47, 0.25);
  border-radius: 5px;
  font: 800 11px/1 "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.portal-home .home-todo-user {
  background: rgba(255, 255, 255, 0.68);
  color: #252a2f;
}

.portal-home .home-todo-new {
  border-color: #f18f01;
  background: #f18f01;
  color: white;
}

.portal-home .home-todo-open {
  border-color: #252a2f;
  background: #252a2f;
  color: white;
}

.portal-home .home-todo-login {
  display: block;
  align-items: center;
  padding: 9px;
  border: 1px dashed rgba(241, 143, 1, 0.68);
  background: rgba(255, 250, 243, 0.82);
}

.portal-home .home-todo-login[hidden] {
  display: none;
}

.portal-home .home-todo-user-choices {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.portal-home .home-todo-user-choices button {
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid rgba(37, 42, 47, 0.24);
  border-radius: 4px;
  background: white;
  color: #252a2f;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.portal-home .home-todo-user-choices button:hover {
  border-color: #f18f01;
  background: #fff4e5;
}

.portal-home .home-todo-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.portal-home .home-todo-column {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(37, 42, 47, 0.15);
  background: rgba(255, 255, 255, 0.35);
}

.portal-home .home-todo-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(37, 42, 47, 0.12);
  background: rgba(255, 255, 255, 0.64);
}

.portal-home .home-todo-column-head h3 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #3c3936;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-home .home-todo-column-head span {
  flex: 0 0 auto;
  color: #716b66;
  font-size: 10px;
  font-weight: 800;
}

.portal-home .home-todo-column-new {
  flex: 0 0 auto;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid #f18f01;
  border-radius: 3px;
  background: #f18f01;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.portal-home .home-todo-column-new:hover {
  border-color: #d97f00;
  background: #d97f00;
}

.portal-home .home-todo-column-new:focus-visible {
  outline: 2px solid rgba(241, 143, 1, 0.58);
  outline-offset: 2px;
}

.portal-home .home-todo-column-list {
  display: grid;
  gap: 5px;
  max-height: 380px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  scrollbar-color: rgba(111, 90, 67, 0.55) transparent;
  scrollbar-width: thin;
}

.portal-home .home-todo-column-list:focus-visible {
  outline: 2px solid rgba(241, 143, 1, 0.75);
  outline-offset: -2px;
}

.portal-home .home-todo-column-empty {
  min-height: 52px;
  display: grid;
  place-items: center;
  margin: 0;
  color: #8b8580;
  font-size: 11px;
}

.portal-home .home-todo-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 58px;
  padding: 7px 8px;
  border: 1px solid rgba(37, 42, 47, 0.14);
  border-left: 5px solid #91979d;
  background: rgba(255, 255, 255, 0.77);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.portal-home .home-todo-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 15px rgba(54, 46, 40, 0.09);
}

.portal-home .home-todo-row[data-priority="당장"] { border-left-color: #d84315; }
.portal-home .home-todo-row[data-priority="오늘 내로"] { border-left-color: #f18f01; }
.portal-home .home-todo-row[data-priority="내일까지"] { border-left-color: #1876b9; }
.portal-home .home-todo-row[data-priority="약국 방문 시"] { border-left-color: #13856b; }

.portal-home .home-todo-row.has-stock {
  border-color: #dc7b00;
  border-left-color: #c8460b;
  background: linear-gradient(90deg, #fff1d1, #fffaf0);
}

.portal-home .home-todo-row.is-private {
  border-top: 2px solid #76509b;
  border-right: 2px solid #76509b;
  border-bottom: 2px solid #76509b;
  box-shadow: inset 5px 0 0 #76509b;
}

.portal-home .home-todo-check {
  width: 21px;
  height: 21px;
  border: 2px solid #747b81;
  border-radius: 50%;
  background: white;
  color: white;
  cursor: pointer;
}

.portal-home .home-todo-check:hover {
  border-color: #f18f01;
  background: #f18f01;
}

.portal-home .home-todo-main {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.portal-home .home-todo-main strong,
.portal-home .home-todo-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-home .home-todo-main strong {
  color: #252a2f;
  font-size: 12px;
  line-height: 1.3;
}

.portal-home .home-todo-main span {
  margin-top: 2px;
  color: #706861;
  font-size: 10px;
}

.portal-home .home-todo-badges {
  grid-column: 2;
  display: flex;
  justify-content: flex-start;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.portal-home .home-todo-badge {
  max-width: 100%;
  overflow: hidden;
  padding: 2px 5px;
  border-radius: 999px;
  background: #e3e5e7;
  color: #353b40;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-home .home-todo-badge.is-stock {
  background: #c8460b;
  color: white;
}

.portal-home .home-todo-badge.is-private {
  background: #76509b;
  color: white;
}

.portal-home .home-todo-empty,
.portal-home .home-todo-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  border: 1px dashed rgba(37, 42, 47, 0.2);
  text-align: center;
  color: #6d655f;
  background: rgba(255, 255, 255, 0.5);
}

.portal-home .home-todo-error { color: #a73b18; }

.portal-home .home-todo-status {
  display: none;
}

.portal-home .home-todo-loading {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
}

.portal-home .home-todo-loading span {
  height: 46px;
  background: linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.85), rgba(255,255,255,.35));
  background-size: 220% 100%;
  animation: home-todo-loading 1.15s linear infinite;
}

@keyframes home-todo-loading {
  to { background-position: -220% 0; }
}

@media (max-width: 860px) {
  .portal-home .home-todo-head { align-items: flex-start; }
  .portal-home .home-todo-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .portal-home .home-todo-panel { padding: 16px 12px 14px; }
  .portal-home .home-todo-head { display: grid; }
  .portal-home .home-todo-actions { justify-content: stretch; display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .portal-home .home-todo-user,
  .portal-home .home-todo-new,
  .portal-home .home-todo-open { padding: 0 7px; font-size: 12px; }
  .portal-home .home-todo-list { grid-template-columns: 1fr; }
  .portal-home .home-todo-user-choices { display: grid; grid-template-columns: repeat(2, 1fr); }
}
