/* Shared icon selection controls used by profile and management screens. */

.application-icon-selector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
  align-items: end;
}

.application-icon-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.application-icon-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.application-icon-select-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 6px 10px;
  text-align: left;
}

.application-icon-select-button:hover {
  border-color: rgba(37, 99, 235, 0.45);
  background: #f7fbff;
}

.application-icon-select-button .menu-icon-box {
  width: 34px;
  height: 34px;
}

.application-icon-select-button strong,
.application-icon-select-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-icon-select-button strong {
  font-size: 13px;
  font-weight: 900;
}

.application-icon-select-button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.application-icon-color {
  display: grid;
  gap: 4px;
}

.application-icon-color span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.application-icon-color input {
  width: 100%;
  min-height: 48px;
}

.icon-picker-dialog {
  height: min(720px, calc(100dvh - 40px));
  width: min(880px, 100%);
  grid-template-rows: auto auto minmax(0, 1fr);
  row-gap: 0;
}

.icon-picker-tab-content {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.icon-picker-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  justify-self: start;
  margin-top: 14px;
  margin-bottom: 0;
  border: 1px solid #c9d8ee;
  border-radius: 8px;
  background: #eef4ff;
  padding: 2px;
}

.icon-picker-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #48617f;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: none;
}

.icon-picker-tabs button.active {
  background: #ffffff;
  color: var(--blue);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.icon-picker-color-panel {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px 12px;
}

.icon-picker-color-panel > div:first-child {
  display: grid;
  gap: 4px;
}

.icon-picker-color-panel > div:first-child span,
.icon-picker-custom-color span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.icon-picker-color-panel > div:first-child strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.icon-picker-color-swatches {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-picker-color-swatches button {
  display: grid;
  width: 28px;
  min-height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
}

.icon-picker-color-swatches button span {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.14);
}

.icon-picker-color-swatches button.selected {
  outline: 2px solid rgba(37, 99, 235, 0.42);
  outline-offset: 2px;
}

.icon-picker-custom-color {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 4px 8px;
}

.icon-picker-custom-color input {
  width: 26px;
  height: 22px;
  border: 0;
  background: transparent;
  padding: 0;
}

.icon-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 92px;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.icon-picker-toolbar label {
  display: grid;
  gap: 6px;
}

.icon-search-field {
  position: relative;
  display: block;
}

.icon-search-field input {
  width: 100%;
  padding-right: 42px;
}

.icon-search-field button {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 26px;
  min-height: 26px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #eef3f9;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
}

.icon-search-field button:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.icon-picker-toolbar label span,
.icon-picker-toolbar div span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.icon-picker-toolbar div {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px 10px;
}

.icon-picker-toolbar strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.icon-upload-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.icon-upload-panel label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  padding: 11px 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.icon-upload-panel label:hover {
  border-color: #bfdbfe;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.icon-upload-panel small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.icon-upload-panel label span {
  color: inherit;
  font-size: 12px;
  font-weight: 850;
}

.icon-upload-panel label .menu-svg-icon {
  width: 14px;
  height: 14px;
}

.icon-upload-panel input {
  display: none;
}

.icon-choice-grid {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 2px;
}

.icon-character-grid {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 2px;
}

.icon-character-choice {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: #26354f;
  padding: 8px;
  text-align: center;
}

.icon-character-choice .menu-icon-box {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 8px;
}

.icon-character-choice .custom-menu-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-character-choice strong {
  font-size: 12px;
  font-weight: 850;
}

.icon-character-choice:hover,
.icon-character-choice.selected {
  border-color: rgba(38, 74, 130, 0.55);
  background: #f7faff;
  box-shadow: 0 10px 24px rgba(31, 45, 68, 0.1);
}

.icon-character-choice.selected {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 1px;
}

.icon-choice {
  display: grid;
  min-height: 96px;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #26354f;
  font: inherit;
  padding: 10px 12px;
  text-align: left;
}

.icon-choice .menu-icon-box {
  grid-row: 1 / span 2;
}

.icon-choice-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.icon-choice strong {
  color: #26354f;
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.icon-choice small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-choice-usage {
  grid-column: 1 / -1;
  display: inline-grid;
  justify-self: start;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 850;
}

.icon-choice-usage.used {
  background: var(--blue-soft);
  color: var(--blue);
}

.icon-choice:hover,
.icon-choice.selected {
  border-color: rgba(38, 74, 130, 0.45);
  background: #f7faff;
  box-shadow: 0 10px 24px rgba(31, 45, 68, 0.08);
}

.icon-choice:hover .menu-icon-box,
.icon-choice.selected .menu-icon-box {
  background: #dbeafe;
  color: var(--blue);
}

@media (max-width: 880px) {
  .icon-picker-toolbar {
    grid-template-columns: 1fr;
  }

  .icon-upload-panel {
    grid-template-columns: 1fr;
  }
}
